* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Download Layered Architecture of Communication Networks (2)
Asynchronous Transfer Mode wikipedia , lookup
Parallel port wikipedia , lookup
Multiprotocol Label Switching wikipedia , lookup
Distributed firewall wikipedia , lookup
IEEE 802.1aq wikipedia , lookup
Remote Desktop Services wikipedia , lookup
Piggybacking (Internet access) wikipedia , lookup
Deep packet inspection wikipedia , lookup
Network tap wikipedia , lookup
Point-to-Point Protocol over Ethernet wikipedia , lookup
List of wireless community networks by region wikipedia , lookup
Airborne Networking wikipedia , lookup
Computer network wikipedia , lookup
Wake-on-LAN wikipedia , lookup
Zero-configuration networking wikipedia , lookup
TCP congestion control wikipedia , lookup
Hypertext Transfer Protocol wikipedia , lookup
Cracking of wireless networks wikipedia , lookup
Recursive InterNetwork Architecture (RINA) wikipedia , lookup
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 © Tallal Elshabrawy 2 TCP/IP: Inter-connecting Networks Cellular Network ARPANET DEST SRC Ethernet © Tallal Elshabrawy Satellite Network Ethernet 3 TCP/IP Reference Model DNS SMTP HTTP TCP RTP UDP IP Network Interface 1 © Tallal Elshabrawy Network Interface 2 Network Interface 3 4 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 © Tallal Elshabrawy 5 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 © Tallal Elshabrawy 6 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 © Tallal Elshabrawy 7 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 © Tallal Elshabrawy 8 TCP/IP vs OSI Reference Model Application Presentation Application Session Transport Transport Network Internet Data Link Network Interface Physical OSI Reference Model © Tallal Elshabrawy TCP/IP Reference Model 9 Example: Web Page Download Network 2 Network 1 cleo.guc.edu.eg 1.4 2.1 1.3 1.1 1.2 2.4 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? © Tallal Elshabrawy 10 HTTP www.cnn. com Get … 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 © Tallal Elshabrawy 11 Establish TCP Connection Q: What is Port? HTTP Client Establish a TCP Connection from port z of 1.1. to port 80 of 2.3 It is a logical interface to help the transport layer identify which application process should be contacted Connection Established Port z Port 80 TCP Connection Request from 1.1 port z to 2.3 port 80 TCP Client ACK, TCP Connection Request from 2.3 port 80 to 1.1 port z TCP Server 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 © Tallal Elshabrawy 12 HTTP Data Transfer using TCP Connection HTTP Client HTTP Server OK, 200 Get … OK, 200 Get … HTML Content Port z HTML Content Port 80 TCP Send (80, z, Get) TCP Client ACK TCP Send (z, 80, Response) TCP Server ACK HTTP uses the TCP connection to transfer data in both directions © Tallal Elshabrawy 13 Interfacing TCP and IP Protocols TCP Server TCP Client Send this datagram to 2.3 Send this datagram to 1.1 Datagram Received IP IP Network Datagram Received IP The role of the IP layer is to attempt its best (best-effort service) to forward datagrams towards their target destination © Tallal Elshabrawy 14 IP Routing: Sending Packets from 1.1 to 2.3 Network 2 Network 1 cleo.guc.edu.eg 1.1 2.3 1.4 TCP Data 1.3 1.1 2.1 1.1 2.3 2.4 TCP Data Router C 2.2 1.2 2.3 CNN.com Destination Next Hop Interface 1.2 1.2 1.1 1.3 1.3 1.1 2.2 1.4 1.1 2.3 1.4 1.1 2.4 1.4 1.1 Routing Table of cleo.guc.edu.eg Destination Next Hop Interface 1.1 1.1 1.4 1.2 1.2 1.4 1.3 1.3 1.4 2.2 2.2 2.1 2.3 2.3 2.1 2.4 2.4 2.1 Routing Table of Router C © Tallal Elshabrawy 15 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 © Tallal Elshabrawy 16 Sending IP Packets over LANs cleo.guc.edu.eg ARP Message: What is the MAC address of 1.4? Router C ARP Message: IP Address 1.4 corresponds to MAC address 3f ARP Message: What is the MAC address of 2.3? Router C © Tallal Elshabrawy ARP Message: IP Address 2.3 corresponds to MAC address 1g CNN.com 17 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) © Tallal Elshabrawy 18 Summary: Sending the TCP Request Cleo.guc.edu.eg CNN.com HTTP TCP IP Frame is an IP datagram Establish a connection to 2.3 at port 80 Open TCP connection to 2.3 port 80 IP datagram is a TCP segment for port 80 Send IP data-gram to Send a datagram (which contains a connection Send IP datagram to 2.3 IP 2.3 request) to 2.3 Send the datagram to 1.4 Ethernet Send Ethernet frame to 3f © Tallal Elshabrawy HTTP Send HTTP Request to CNN.com Ethernet Router C 1.4 Frame is an IP datagram Ethernet TCP IP Send the datagram Ethernet to 2.3 Router C Ethernet frame Send 2.3to 1g 19 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 © Tallal Elshabrawy “Communications Networks 2nd Edition”, A. Leon-Garcia, and I. Widjaja, McGraw Hill, 2003 20 Top Pane Ethereal windows shows frame/packet sequence Middle Pane shows encapsulation for a given frame Bottom Pane shows hex & text © Tallal Elshabrawy “Communications Networks 2nd Edition”, A. Leon-Garcia, and I. Widjaja, McGraw Hill, 2003 21 Top pane: frame sequence DNS Query © Tallal Elshabrawy TCP Connection Setup HTTP Request & Response “Communications Networks 2nd Edition”, A. Leon-Garcia, and I. Widjaja, McGraw Hill, 2003 22 Middle pane: Encapsulation Ethernet Frame Protocol Type © Tallal Elshabrawy Ethernet Destination and Source Addresses “Communications Networks 2nd Edition”, A. Leon-Garcia, and I. Widjaja, McGraw Hill, 2003 23 Middle pane: Encapsulation And a lot of other stuff! IP Packet IP Source and Destination Addresses Protocol Type © Tallal Elshabrawy “Communications Networks 2nd Edition”, A. Leon-Garcia, and I. Widjaja, McGraw Hill, 2003 24 Middle pane: Encapsulation TCP Segment Source and Destination Port Numbers GET HTTP Request © Tallal Elshabrawy “Communications Networks 2nd Edition”, A. Leon-Garcia, and I. Widjaja, McGraw Hill, 2003 25