1. Layered Architecture of Communication Networks: TCP/IP Model
Emergence of TCP/IP ARPANET was a research network supported by US DoD (Department of Defense) interconnecting universities and government installations using telephone leased lines When satellite and radio networks were added, existing protocols had trouble inter-working the three networks together TCP/IP Reference Model: The ability to connect multiple networks together in a seamless way One of the main objectives of DoD was that communications can survive hardware failures
TCP/IP: Inter-connecting Networks Cellular Network ARPANET SRC DEST Ethernet Satellite Network Ethernet
TCP/IP Reference Model HTTP SMTP DNS RTP TCP UDP IP Network Interface 1 Network Interface 2 Network Interface 3
Application Layer Incorporates functions of the top three OSI layers Example Protocols HTTP (Hypertext Transfer Protocol) Publishing and receiving HTML pages SMTP (Simple Mail Transfer Protocol) Sending emails towards a server DNS (Domain Name System) Helps to map ASCII strings (URLs) to IP addresses RTP (Real-time Transport Protocol) Delivering audio and video over the Internet
Transport Layer TCP (Transport Control Protocol) Reliable connection-oriented transfer of a byte stream Applies error recovery and flow control mechanisms UDP (User Datagram Protocol) Unreliable best-effort connectionless transfer of individual messages No message sequencing or flow control. Leaves the upper layer to decide how to deal with these situations Used by applications that require quick delivery and has some tolerance to information loss
Internet Layer Handles transfer of datagrams (packets) across multiple networks Best-effort connectionless packet transfer Best-effort means best-effort. The IP layer attempts to send the datagrams towards the destination It does not guarantee the transfer would be successful It does not guarantee the datagtams would arrive in sequence Handles routing and congestion control
Network Interface It is not really a layer. Rather it defines an interface to underlying networks TCP/IP assumes that data-link and physical layers are part of the underlying network design TCP/IP reference model is only concerned with inter-connecting functional networks
TCP/IP vs OSI Reference Model Application Presentation Session Transport Network Data Link Physical Application Transport Internet Network Interface OSI Reference Model TCP/IP Reference Model
Example: Web Page Download Network 1 Network 2 cleo.guc.edu.eg 1.4 2.1 1.1 1.3 2.4 1.2 2.2 2.3 CNN.com Assume a host on cleo.guc.edu.eg connected to Network 1 wants to read the news on CNN.com whose server is located on Network 2 Let us simplify the IP addresses to x.y where x is the network id y is the terminal id of a particular network HOW DOES THE DOWNLOAD OCCUR?
HTTP Web browser runs an HTTP client program Get … www.cnn.com 200 OK … HTML Content Web browser runs an HTTP client program Web server runs an HTTP server program HTTP Protocol HTTP client sends its request message: Get … Relevant information associated with Get request Server’s IP address : 2.3 Filename : index.html Host’s IP address : 1.1 HTTP server sends a status response HTTP server send HTML data content
Establish TCP Connection Q: What is Port? HTTP Client It is a logical interface to help the transport layer identify which application process should be contacted Establish a TCP Connection from port z of 1.1. to port 80 of 2.3 Connection Established Port z Port 80 TCP Connection Request from 1.1 port z to 2.3 port 80 TCP Client TCP Server ACK, TCP Connection Request from 2.3 port 80 to 1.1 port z ACK Before the HTTP client can send anything, a TCP connection must be established TCP connection uses a three-way handshake Note that at this phase, we have yet to get the HTTP server involved in any communications
HTTP Data Transfer using TCP Connection HTTP Client HTTP Server Get … OK, 200 HTML Content Get … OK, 200 HTML Content Port z Port 80 TCP Send (80, z, Get) TCP Client TCP Server ACK TCP Send (z, 80, Response) ACK HTTP uses the TCP connection to transfer data in both directions
Interfacing TCP and IP Protocols TCP Client TCP Server Send this datagram to 2.3 Datagram Received Send this datagram to 1.1 Datagram Received IP IP Network IP The role of the IP layer is to attempt its best (best-effort service) to forward datagrams towards their target destination
IP Routing: Sending Packets from 1.1 to 2.3 Network 1 Network 2 cleo.guc.edu.eg 1.4 2.1 1.1 1.3 2.4 Router C 1.2 2.2 2.3 CNN.com Destination Next Hop Interface 1.2 1.1 1.3 2.2 1.4 2.3 2.4 Destination Next Hop Interface 1.1 1.4 1.2 1.3 2.2 2.1 2.3 2.4 Routing Table of cleo.guc.edu.eg Routing Table of Router C
IP Routing Terminal 1.1 may only send a packet directly to destinations within the same network How would 1.1 know if the destination is in the same network? By looking at the prefix of the IP address Terminal 2.3 is not on the same network as 1.1 The IP layer of cleo.guc.edu.eg has a routing table that says: If you wish to reach 2.3 then you have to go through router (gateway) 1.4 Router C has multiple interfaces each of which corresponds to an IP address The routing table of Router C indicates that if you want to reach 2.3 then you will need to send over the interface which has the IP address 2.1
Sending IP Packets over LANs cleo.guc.edu.eg Router C ARP Message: What is the MAC address of 1.4? ARP Message: IP Address 1.4 corresponds to MAC address 3f ARP Message: What is the MAC address of 2.3? Router C CNN.com ARP Message: IP Address 2.3 corresponds to MAC address 1g
Sending IP Packets over LAN To send an IP datagram to IP Address 1.4, cleo.guc.edu.eg puts the IP datagram in an Ethernet frame, and transmits the frame. However, Ethernet uses different addresses, so-called Media Access Control (MAC) addresses (also called: physical address, hardware address) Therefore, Argon must first translate the IP address 1.4 into a MAC address. The translation of addressed is performed via the Address Resolution Protocol (ARP)
Summary: Sending the TCP Request Cleo.guc.edu.eg CNN.com HTTP Send HTTP Request to CNN.com HTTP Establish a connection to 2.3 at port 80 TCP Open TCP connection to 2.3 port 80 TCP IP datagram is a TCP segment for port 80 Send a datagram (which contains a connection request) to 2.3 Send IP data-gram to 2.3 Send IP datagram to 2.3 IP IP IP Frame is an IP datagram Frame is an IP datagram Send the datagram to 1.4 Send the datagram to 2.3 Ethernet Ethernet Ethernet Ethernet Send Ethernet frame to 3f Send Ethernet frame to 1g Router C Router C 2.3 1.4
How the layers work together Internet User clicks on http://www.nytimes.com/ Ethereal network analyzer captures all frames observed by its Ethernet NIC Sequence of frames and contents of frame can be examined in detail down to individual bytes “Communications Networks 2nd Edition”, A. Leon-Garcia, and I. Widjaja, McGraw Hill, 2003
Ethereal windows Top Pane shows frame/packet sequence Middle Pane shows encapsulation for a given frame Ethereal windows Bottom Pane shows hex & text “Communications Networks 2nd Edition”, A. Leon-Garcia, and I. Widjaja, McGraw Hill, 2003
Top pane: frame sequence TCP Connection Setup DNS Query HTTP Request & Response “Communications Networks 2nd Edition”, A. Leon-Garcia, and I. Widjaja, McGraw Hill, 2003
Middle pane: Encapsulation Ethernet Frame Ethernet Destination and Source Addresses Protocol Type “Communications Networks 2nd Edition”, A. Leon-Garcia, and I. Widjaja, McGraw Hill, 2003
Middle pane: Encapsulation And a lot of other stuff! IP Packet IP Source and Destination Addresses Protocol Type “Communications Networks 2nd Edition”, A. Leon-Garcia, and I. Widjaja, McGraw Hill, 2003
Middle pane: Encapsulation TCP Segment Source and Destination Port Numbers GET HTTP Request “Communications Networks 2nd Edition”, A. Leon-Garcia, and I. Widjaja, McGraw Hill, 2003