Communication Networks NETW 501 Lecture 3 Layered Architecture

  • Slides: 26
Download presentation
Communication Networks NETW 501 Lecture 3 Layered Architecture of Communication Networks: TCP/IP Model Course

Communication Networks NETW 501 Lecture 3 Layered Architecture of Communication Networks: TCP/IP Model Course Instructor: Dr. -Ing. Maggie Mashaly maggie. ezzat@guc. edu. eg C 3. 220 1

Emergence of TCP/IP Problem: • When satellite and radio networks were added, existing protocols

Emergence of TCP/IP Problem: • When satellite and radio networks were added, existing protocols had trouble inter-working the three networks together • ARPANET was a research network supported by US Do. D (Department of Defense) interconnecting universities and government installations using telephone leased lines. • And they had a solution for the problem! Solution: • TCP/IP Reference Model: Ø The ability to connect multiple networks together in a seamless way Ø One of the main objectives of Do. D was that communications can 2

TCP/IP: Inter-connecting Networks Cellular Network ARPANET DEST SRC Ethernet Satellite Network Ethernet 3

TCP/IP: Inter-connecting Networks Cellular Network ARPANET DEST SRC Ethernet Satellite Network Ethernet 3

TCP/IP vs OSI Reference Model Application Presentation Application Session Transport Network Internet Data Link

TCP/IP vs OSI Reference Model Application Presentation Application Session Transport Network Internet Data Link Network Interface Physical OSI Reference Model TCP/IP Reference Model 4

TCP/IP Reference Model DNS SMTP HTTP RTP Application TCP UDP Transport IP Network Interface

TCP/IP Reference Model DNS SMTP HTTP RTP Application TCP UDP Transport IP Network Interface 1 Network Interface 2 Internet Network Interface 3 Network Interface 5

Application Layer Application • Incorporates functions of the top three OSI layers • Example

Application Layer Application • Incorporates functions of the top three OSI layers • Example Protocols: Ø HTTP (Hypertext Transfer Protocol) › Publishing and receiving HTML pages Transport Internet Network Interface Ø 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 6

Transport Layer • TCP (Transport Control Protocol) – Reliable connection-oriented transfer of a byte

Transport Layer • TCP (Transport Control Protocol) – Reliable connection-oriented transfer of a byte stream – Applies error recovery and flow control mechanisms Application Transport Internet Network Interface • 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 7

Internet Layer • Handles transfer of datagrams (packets) across multiple networks • Best-effort connectionless

Internet Layer • Handles transfer of datagrams (packets) across multiple networks • Best-effort connectionless packet transfer Application Transport Internet – Best-effort means best-effort. Network Interface 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 datagrams would arrive in sequence • Handles routing and congestion control 8

Network Interface • It is not really a layer. Rather it defines an interface

Network Interface • It is not really a layer. Rather it defines an interface to underlying networks Application Transport Internet • TCP/IP assumes that data-link and physical layers are part of the underlying network design Network Interface • TCP/IP reference model is only concerned with inter-connecting functional networks 9

Example: Web Page Download Network 2 Network 1 cleo. guc. edu. eg 1. 4

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? 10

HTTP www. cnn. c om Get … 200 OK … HTML Content • Web

HTTP www. cnn. c om 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 sends HTML data content 11

Establish TCP Connection Q: What is Port? HTTP Client Establish a TCP Connection from

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 Connection Established Port z It is a logical interface to help the transport layer identify which application process should be contacted 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 ACK TCP Server • 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 12

HTTP Data Transfer using TCP Connection HTTP Client HTTP Server OK, 200 Get …

HTTP Data Transfer using TCP Connection HTTP Client HTTP Server 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 13

Interfacing TCP and IP Protocols TCP Server TCP Client Send this datagram to 2.

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 14

IP Routing: Sending Packets from 1. 1 to 2. 3 Network 2 Network 1

IP Routing: Sending Packets from 1. 1 to 2. 3 Network 2 Network 1 cleo. guc. edu. eg 1. 4 1. 3 1. 1 2. 4 Router C 2. 2 1. 2 2. 3 CNN. com Destination Next Hop Interface 1. 2 1. 1 1. 3 1. 1 2. 2 1. 4 1. 1 2. 3 1. 4 1. 1 2. 4 1. 1 Routing Table of cleo. guc. edu. eg Destination Next Hop Interface 1. 1 1. 4 1. 2 1. 4 1. 3 1. 4 2. 2 2. 1 2. 3 2. 1 2. 4 2. 1 Routing Table of Router C 15

IP Routing How does it work? • Terminal 1. 1 may only send a

IP Routing How does it work? • 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 16

Sending IP Packets over LANs cleo. guc. edu. eg ARP Message: What is the

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 3 f ARP Message: What is the MAC address of 2. 3? Router C ARP Message: IP Address 2. 3 corresponds to MAC address 1 g CNN. com 17

Sending IP Packets over LAN How does it work? • To send an IP

Sending IP Packets over LAN How does it work? • 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, we must first translate the IP address 1. 4 into a MAC address. • The translation of addresses is performed via the Address Resolution Protocol (ARP) 18

Summary: Sending the TCP Request Cleo. guc. edu. eg CNN. com HTTP TCP IP

Summary: Sending the TCP Request Cleo. guc. edu. eg CNN. com HTTP TCP IP Frame is an IP datagram Ethernet HTTP Send HTTP Request to CNN. com 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 Send Ethernet frame to 3 f 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. 3 to 1 g 19

How the layers work together? Internet l User clicks on http: //www. nytimes. com/

How the layers work together? Internet l User clicks on http: //www. nytimes. com/ l Ethereal network analyzer captures all frames observed by its Ethernet NIC l Sequence of frames and contents of frame can be examined in detail down to individual bytes 20

Top Pane shows Ethereal Windows frame/packet sequence Middle Pane shows encapsulation for a given

Top Pane shows Ethereal Windows frame/packet sequence Middle Pane shows encapsulation for a given frame Bottom Pane shows hex & text 21

Top Pane: Frame sequence DNS Query TCP Connection Setup HTTP Request & Response 22

Top Pane: Frame sequence DNS Query TCP Connection Setup HTTP Request & Response 22

Middle Pane: Encapsulation Ethernet Frame Protocol Type Ethernet Destination and Source Addresses 23

Middle Pane: Encapsulation Ethernet Frame Protocol Type Ethernet Destination and Source Addresses 23

Middle Pane: And. Encapsulation a lot of other stuff! IP Packet IP Source and

Middle Pane: And. Encapsulation a lot of other stuff! IP Packet IP Source and Destination Addresses Protocol Type 24

Middle Pane: Encapsulation TCP Segment Source and Destination Port Numbers GET HTTP Request 25

Middle Pane: Encapsulation TCP Segment Source and Destination Port Numbers GET HTTP Request 25

References • NETW 501 Lectures slides by Assoc. Prof. Tallal El-Shabrawy • “Communication Networks

References • NETW 501 Lectures slides by Assoc. Prof. Tallal El-Shabrawy • “Communication Networks 2 nd Edition”, A. Leon-Garcia and I. Widjaja, Mc. Graw Hill, 2013 • “Computer Networks 4 th Edition”, A. S. Tanenbaum, Pearson International 26