2Introduction To TCP/IP Transmission Control Protocol/Internet Protocol (TCP/IP)Most commonly used network protocol suite todayWide vendor supportOpen protocolProvides access to Internet servicesWindows Server 2003Can use several protocolsMany of its main features require the use of TCP/IP
3Internet History: Early packet-switching principles1961: Kleinrock - queueing theory shows ` effectiveness of packet-switching1964: Baran - packet-switching in military nets1967: ARPAnet conceived by Advanced Research Projects Agency1969: first ARPAnet node operational1972: ARPAnet demonstrated publicly, NCP (Network Control Protocol) first host-host protocol, first e mail program. ARPAnet has 15 nodes1.8.13
4Internet History 1970: ALOHAnet satellite network in Hawaii : Internetworking, new and proprietary nets1970: ALOHAnet satellite network in Hawaii1973: Metcalfe’s PhD thesis proposes Ethernet1974: Cerf and Kahn - architecture for interconnecting networkslate70’s: proprietary architectures,DECnet, SNA, XNA1979: ARPAnet has 200 nodes1.8.24
5Internet History Cerf and Kahn’s internetworking principles: : Internetworking, new and proprietary netsCerf and Kahn’s internetworking principles:minimalism, autonomy-no internal changes required to interconnect networksbest effort service modelstateless routersdecentralized controldefine today’s Internet architecture1.8.25
6Internet History 1983: deployment of TCP/IP : new protocols, a proliferation of networks1983: deployment of TCP/IP1982: SMTP protocol defined1983: DNS defined for name-to-IP address translation1985: FTP protocol defined1988: TCP congestion control1.8.36
7Internet History US networks: Csnet, BITnet, NSFnet, Minitel : new protocols, a proliferation of networksUS networks: Csnet, BITnet, NSFnet, Minitel100,000 hosts connected to confederation of networks1.8.37
8Internet History Early 1990’s: ARPAnet decommissioned 1990, 2000’s: commercialization, the Web, new appsEarly 1990’s: ARPAnet decommissioned1991: NSF lifts restrictions on commercial use of NSFnet (decommissioned, )early 1990s: Webhypertext [Bush 1945, Nelson 1960’s]HTML, HTTP: Berners-Lee1994: Mosaic, later Netscapelate 1990’s: commercialization of the Web1.8.48
9Internet History Late 1990’s – 2000’s: 1990, 2000’s: commercialization, the Web, new appsLate 1990’s – 2000’s:more killer apps: instant messaging,peer-2-peer file sharing (e.g., Naptser)network security to forefrontest. 50 million host, 100 million+ usersbackbone links running at Gbpsnow: Gbps (youtube, social networking)1.8.49
10The (capital “I”) Internet The world-wide network of TCP/IP networksDifferent people or organisations own different partsDifferent parts use different technologiesInterconnections between the partsInterconnections require agreementssale/purchase of servicecontracts“peering” agreementsNo central control or management
11The principle of “Internetworking” We have lots of little networksMany different owners/operatorsMany different typesEthernet, dedicated leased lines, dialup, optical, broadband, wireless, ...Each type has its own idea of low level addressing and protocolsWe want to connect them all together and provide a unified view of the whole lot (treat the collection of networks as a single large internetwork)
12What’s the Internetmillions of connected computing devices: hosts, end-systemsPC’s workstations, serversPDA’s phones,communication linksfiber, copper, radio, satelliterouters: forward packets (chunks) of data through networklocal ISPcompanynetworkregional ISProuterworkstationservermobile
13TCP/IP Architecture Overview The TCP/IP model can be broken down into four layers:ApplicationTransportInternetPhysical Network InterfaceApplication layer provides access to network resources. It defines rules, commands, and procedures for client to talk to a service running on a server
14TCP/IP Architecture Overview (continued) Transport layer is responsible for preparing data ready to be transported across the networkInternet layer is responsible for logical addressing and routingPhysical Network Interface layer consists of the network card driver and the network card itself
16The TCP/IP Model SMTP HTTP FTP Telnet DNS Audio Video TCP UDP RTP IP Application layerSMTPHTTPFTPTelnetDNSAudioVideoTCPUDPRTPTransport layerIPNetwork layerEthernetPPPATMOpticsADSLSatellite3GPhysical and Data link layer
17Layer Interaction: TCP/IP Model ApplicationApplicationTCP or UDPTCP or UDPIPIPIPIPLinkLinkLinkLinkLinkLinkPhysicalPhysicalPhysicalRouterHostHostRouter
18Layer Interaction: The Application Layer Applications behave as if they can talk to each other, but in reality the application at each side talks to the TCP or UDP service below it.ApplicationApplicationThe application layer doesn't care about what happens at the lower layers, provided the transport layer carries the application's data safely from end to end.TCP or UDPTCP or UDPIPIPIPIPLinkLinkLinkLinkLinkLinkPhysicalPhysicalPhysicalRouterHostHostRouter
19Layer Interaction: The Transport Layer The transport layer instances at the two ends act as if they are talking to each other, but in reality they are each talking to the IP layer below it. The transport layer doesn't care about what the application layer is doing above it.ApplicationApplicationTCP or UDPTCP or UDPThe transport layer doesn't care what happens in the IP layer or below, as long as the IP layer can move datagrams from one side to the other.IPIPIPIPLinkLinkLinkLinkLinkLinkPhysicalPhysicalPhysicalRouterHostHostRouter
20Layer Interaction: The Network Layer (IP) The IP layer has to know a lot about the topology of the network (which host is connected to which router, which routers are connected to each other), but it doesn't care about what happens at the upper layers.ApplicationApplicationTCP or UDPTCP or UDPIPIPIPIPThe IP layer works forwards messages hop by hop from one side to the other side.LinkLinkLinkLinkLinkLinkPhysicalPhysicalPhysicalRouterHostHostRouter
21Layer Interaction: Link and Physical Layers The link layer doesn't care what happens above it, but it is very closely tied to the physical layer below it.All links are independent of each other, and have no way of communicating with each other.ApplicationApplicationTCP or UDPTCP or UDPIPIPIPIPLinkLinkLinkLinkLinkLinkPhysicalPhysicalPhysicalRouterHostHostRouter
22A Flow of Application messages across TCP/IP layers Messages (UDP) or Streams (TCP)ApplicationTransportInternetUDP or TCP segmentIP PacketsNetwork-specific framesMessageLayersUnderlying networkPhysical Network interface
23Encapsulation of a message transmitted via TCP over an Ethernet Application messageTCP headerIP headerEthernet headerEthernet frameportTCPIP
24Layering: physical communication dataapplicationtransportnetworklinkphysicalnetworklinkphysicalapplicationtransportnetworklinkphysicaldataapplicationtransportnetworklinkphysicalapplicationtransportnetworklinkphysical
25Application Layer Protocols There are many Application layer protocols, each of which is associated with a client application and service provided by a server (Client/Server Model)HTTPFTPTELNETSMTPPOP3IMAP4
27Application Layer Protocols HTTPHypertext Transfer Protocol (HTTP) is the most common protocol used on the Internet todayHTTP defines the commands that Web browsers can send and how Web servers are capable of respondingFTPFile Transfer Protocol (FTP) is file-sharing protocolFTP is implemented in stand-alone FTP clients as well as in Web browsersIt is safe to say that most FTP users today are using Web browsers
28Application Layer Protocols TELNETTelnet is a terminal emulation protocol that is primarily used to connect remotely to UNIX and Linux SystemsThe Telnet protocol specifies how a telnet server and telnet client communicate
29Application Layer Protocols SMTPSimple Mail Transfer Protocol (SMTP) is used to send and receive messages between servers that are communicatingIt is used by client software, such as Outlook Express, to send messages to the serverSMTP is never used to retrieve from a server when you are reading itOther protocols control the reading of messages
30Application Layer Protocols POP3Post Office Protocol version 3 (POP3) is the most common protocol used for reading messagesThis protocol has commands to download messages and delete messages from the mail serverPOP3 does not support sending messagesPOP3 supports only a single inbox and does not support multiple folders for storage on the server
31Application Layer Protocols IMAP4Internet Message Access Protocol version 4 (IMAP4) is another common protocol used to read messagesIMAP4 can download message headers only and allow you to choose which messages to downloadIMAP4 allows for multiple folders on the server side to store messages
32Transport Layer Protocols Transport layer protocols (TCP & UDP) are responsible for getting data ready to move across the networkThe most common task performed by Transport layer protocols is breaking entire messages down into segments suitable to form packetsTransport layer protocols use port numbersWhen a segment is addressed to a particular port, the Transport layer protocol knows to which service to deliver the packet
33TCPTransmission Control Protocol (TCP) is the most commonly used Transport layer protocol for most Internet servicesTCP is connection-oriented and reliableConnection-oriented means that TCP creates and verifies a connection with a remote host before sending informationVerifies that the remote host exists and is willing to communicate before starting the conversationProvides flow control, segmentation, and error control
34TCP Connection-oriented Establishes a connection before transmitting dataThree-way handshakeSYNSYN/ACKACK
35Send more data, wait for ACK TCPError control & Flow controlRequire acknowledgements from receiver to ensure data was received correctlyChecksumUnique character string allowing receiving node to determine if arriving data unit exactly matches data unit sent by sourceEnsures data integritySend data, wait for ACKACKSend more data, wait for ACK
36TCP Segmentation Sequencing Reassembly Breaking large data units received from Session layer into multiple smaller units called segmentsIncreases data transmission efficiencyMTU (maximum transmission unit): Largest data unit network will carry (Ethernet default: 1500 bytes)SequencingMethod of identifying segments belonging to the same group of subdivided dataReassemblyProcess of reconstructing segmented data units
37Transport Layer (cont’d.) Figure 2-2 Segmentation and reassembly
38TCP Segment1234567891011User Data1 Source ID or port 16 bits2 Destination ID or port 16 bits3 Sequence number 32 bits4 ACK number 32 bits5 Header length 4 bits6 Unused 6 bits7 Flags 6 bits8 Flow control 16 bits9 CRC bits10 Urgent pointer 16 bits11 Options 16 bits
39UDP User Datagram Protocol (UDP) UDP is the appropriate if Not as commonly used as TCPUsed for different servicesConnectionless and unreliableUDP is the appropriate ifUnconcerned about missing packetsWant to implement reliability in a special wayStreaming audio and video are in this category
40UDP – Segment 1 2 3 4 User Data Source ID or port Destination ID or portLength4 Checksum
41TCP versus UDP TCP is connection-oriented and reliable Like registered mailUDP is connectionless and unreliableLike sending a message split on several postcards and assuming that the receiver will be able to put the message together
42Internet Layer Protocols Internet layer protocols are responsible for all tasks related to logical addressingAn IP address is a logical addressAny protocol that is aware of other networks exists at this layerEach Internet layer protocol is very specializedThey include: IP, RIP and OSPF, ICMP, IGMP, and ARP
43Internet Layer Protocols IPInternet Protocol (IP) is responsible for the logical addressing of each packet created by the Transport layer to produce a complete IP PacketAs each packet is built, IP adds the source and destination IP address to the IP packetICMPInternet Control Messaging Protocol (ICMP) is used to send IP error and control messages between routers and hostsThe most common use of ICMP is the ping utility
44IP Packet version 41234567891011IP41213141 Version number 4 bits2 Header length 4 bits3 Type of Service 8 bits4 Total length 16 bits5 Identifiers 16 bits6 Flags 3 bits7 Packet offset 13 bits8 Hop limit 8 bits9 Protocol 8 bits10 CRC bits11 Source address 32 bits12 Destination Address 32 bits13 Options varies14 User data varies
45Internet Layer Protocols IGMPInternet Group Management Protocol (IGMP) is used for the management of multicast groupsHosts use IGMP to inform routers of their membership in multicast groupsRouters use IGMP to announce that their networks have members in particular multicast groupsThe use of IGMP allows multicast packets to be distributed only to routers that have interested hosts connected
46Internet Layer Protocols ARPAddress Resolution Protocol (ARP) is used to convert logical IP addresses to physical MAC addressesThis is an essential part of the packet delivery process
47Network Interface Layer Protocols Most of the common Network Interface layer protocols are defined by the Institute of Electrical and Electronics Engineers (IEEE)
48IP Addresses Internet Protocol (IP): a protocol used in the internet layer.IP makes use of the existing networks to deliver information, where these networks may use a variety of protocols.Each computer has two addresses:hardware address: used by the underlying network protocol for deliver data frame;IP address: used by the internetworking protocols for deliver IP Packet.Hardware address is also known as physical address.
49Types of addresses used on hosts Address Example Software Example AddressApplication Layer Web browserNetwork Layer TCP/IP :80Data Link Layer Ethernet 00-0C-00-F5-03-5A
50IP Addresses IP Addressing Scheme Each computer / router is assigned a unique IP address having 32 bits.Each IP address has two parts:The prefix (network ID or NetID) specifies the network to which the computer is attached.The suffix (HostID) specifies a particular computer on a network.ProblemGiven only 32 bits, how many bits should be allocated to the prefix and the suffix?around 4 billion addresses.
51IP Addresses IP Addressing Scheme Considerations If the prefix has many bits (large prefix, small suffix), there are many networks you can built but each network can only have a few computers.If the prefix has a few bits (small prefix, large suffix), there are only few networks you can built but each network can have many computers.
52Subnet MasksA subnet mask defines which part of its IP address is the network ID and which part is the host IDSubnet masks are composed of four octets just like an IP addressWherever there is a 255 in the subnet mask, that octet is part of the network IDWherever there is a 0 in the subnet mask, that octet is part of the host ID
53Subnet Masks (continued) A computer uses its subnet mask to determineWhich network it is onWhether other computers are on the same network or a different networkIf two computers on the same network are communicating, then they can deliver packets directly to each otherIf two computers are on different networks, they must use a router to communicate
55IP Address ClassesThe IP addressing scheme defines three primary classes (A,B,C), where each class has a distinct prefix/suffix size, and two reserved classes (D&E).The internet can accommodate large networks, medium networks, and small networks.Classes A, B, C are the primary classes. The IP addresses of computers and routers belong to these classes.Class D is used for multicasting. When a packet is sent to an IP multicast address, all the computers sharing this address will receive this packet.Class E addresses are considered experimental and are not used
59Each packet sent across the internet contains: In each primary class, the number of networks and the number of computers per network are as follows:Each packet sent across the internet contains:the IP address of the source, andthe IP address of the destination.
60Dotted Decimal Notation Commonly we use the dotted decimal notation to represent the 32-bit IP address.more convenient for human to manipulateEach octet (8-bit) is expressed as a decimal value, and adjacent decimal values are separated by a dot.Example:
61Other special value of primary classes: Loopback address127.x.x.xintended for use in testing TCP/IP and for inter-process communication on the local computerOther special value of primary classes:
62Assigning IP Addresses Assigning Prefix AddressEach network must have a unique prefix address throughout an internet.To connect a network to the global internet, an organization obtains a unique prefix address from the Internet Service Provider (ISP).In turn, the ISP coordinates with a central organization (the Internet Assigned Number Authority (IANA, on or before 1998); the Internet Corporation for Assigned Names and Numbers (ICANN, after 1998)) to ensure the uniqueness of the prefix.To connect a network to a private internet (Intranet), the organization can determine the prefix while ensuring its uniqueness.
63Assigning IP Addresses Assigning Suffix AddressEach computer must have a unique suffix address in the same network; while two computers in two different networks can have identical suffix address or HostID.If the suffix is 00…0 or 11…1, the corresponding IP addresses have special meaning. Do not assign these suffixes.An IP address with suffix equal to 00…0 is used to refer to the network itself.An IP address with suffix equal to 11…1 is a directed broadcast address, i.e., it refers to all hosts on the network.
64Firstly, assign a unique prefix to each network: ExampleAn organization wants to form a private TCP/IP internet with four networks, where one network is large (with many computers), two are medium, and one is small.Firstly, assign a unique prefix to each network:Assign a class A prefix for the large network (say, 10).Assign a class B prefix for each of the two medium networks (say, and ).Assign a class C prefix for the small network (say, ).Secondly, assign a unique suffix to each computer within each network:
66Private IP Addresses You can use these addresses on any private LAN. You CANNOT use them on the internet.Internet routers will block them.
67Default Gateway Default gateway is another term for router If a computer does not know how to deliver a packet, it gives the packet to the default gateway to deliverRouters can distinguish multiple networks and how to move packets between themRouters can also figure out the best path to use to move a packet between different networks
68Classful IP AddressA classful network had a “natural” or “implied” prefix length or netmask:Class A: prefix length /8 (netmask )Class B: prefix length /16 (netmask )Class C: prefix length /24 (netmask )Modern (classless) routing systems have explicit prefix lengths or netmasksYou can't just look at an IP address to tell what the prefix length or netmask should be. Protocols and configurations need explicit netmask or prefix length.
69Classless addressing An ISP gets a large block of addresses Internet routing and address management today is classlessCIDR = Classless Inter-Domain Routingrouting does not assume that class A, B, C implies prefix length /8, /16, /24An ISP gets a large block of addressese.g., a /16 prefix, or separate addresses
70Classless addressing Allocate smaller blocks to customers e.g., a /26 prefix (64 addresses) to 4 customers for their medium public networks, a /28 prefix (16 addresses) to 32 customers for their medium public networks, and a /29 prefix (8 addresses) to another 64 customers for their small public networks (and some space left over for other customers)
71Binary presentation of Classless IP / (netmask )/ (netmask )/ (netmask )
72Classless addressing exercise Consider the address block /28 and /29.What are the IP addresses range can you obtain from each block?in prefix length notationnetmasks in decimalIP address rangesWhat blocks are still available (not yet allocated)?
74Sockets and Ports Processes assigned unique port numbers Process’s socketPort number plus host machine’s IP addressPort numbersSimplify TCP/IP communicationsEnsures data transmitted correctly to the specific application among multiple applications running on same hostExampleTelnet port number: 23IPv4 host address:Socket address: :23
75Sockets and Ports (cont’d.) Figure 4-12 A virtual connection for the Telnet service
76Sockets and Ports (cont’d.) Port number range: 0 to 65535Three typesWell Known PortsRange: 0 to 1023Operating system or administrator useRegistered PortsRange: 1024 to 49151Network users, processes with no special privilegesDynamic and/or Private PortsRange: through 65535No restrictions
77Sockets and Ports (cont’d.) Table 4-3 Commonly used TCP/IP port numbers