Upload
violet-allen
View
233
Download
0
Tags:
Embed Size (px)
Citation preview
1. Layered Architecture of Communication Networks: TCP/IP Model
2© Tallal Elshabrawy
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
3© Tallal Elshabrawy
TCP/IP: Inter-connecting Networks
Ethernet Ethernet
Cellular Network
Satellite Network
ARPANET
SRC
DEST
4© Tallal Elshabrawy
TCP/IP Reference Model
HTTP SMTP DNS RTP
TCP UDP
IP
Network Interface 1
Network Interface 2
Network Interface 3
5© Tallal Elshabrawy
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
6© Tallal Elshabrawy
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
7© Tallal Elshabrawy
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
8© Tallal Elshabrawy
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
9© Tallal Elshabrawy
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
10© Tallal Elshabrawy
Example: Web Page Download
Network 2Network 1
1.1
1.2
1.3
1.4
2.1
2.2
2.3
2.4
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?
cleo.guc.edu.eg
CNN.com
11© Tallal Elshabrawy
HTTP
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
Get …
200 OK …
HTML Content
www.cnn.com
12© Tallal Elshabrawy
Establish TCP Connection
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 Client
TCP Client
Port z
Connection Established
Establish a TCP Connection from port z of 1.1. to port 80 of 2.3
Port 80
TCP Server
TCP Connection Request from 1.1 port z to 2.3 port 80
ACK, TCP Connection Request
from 2.3 port 80 to 1.1 port zACK
It is a logical interface to help the transport layer
identify which application process should be
contacted
Q: What is Port?
13© Tallal Elshabrawy
HTTP uses the TCP connection to transfer data in both directions
HTTP Client
TCP Client
Port z
Get …
Port 80
TCP Server
TCP Send (80, z, Get)
TCP Send (z, 80, Response)
ACK
HTTP Server
OK, 200
HTML Content
ACK
Get …OK, 200
HTML Content
HTTP Data Transfer using TCP Connection
14© Tallal Elshabrawy
Interfacing TCP and IP Protocols
IP
Send this datagram to
2.3
Datagram Received
TCP Server
IP
Send this datagram to
1.1
Datagram Received
TCP Client
The role of the IP layer is to attempt its best (best-effort service) to forward datagrams towards their target destination
IP Network
IP Network
15© Tallal Elshabrawy
Network 2Network 1
1.1
1.2
1.3
1.4
2.1
2.2
2.3
2.4
cleo.guc.edu.eg
CNN.com
1.1 2.3 TCP Data1.1 2.3 TCP Data
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
1.1 2.3 TCP Data1.1 2.3 TCP Data
Router C
IP Routing: Sending Packets from 1.1 to 2.3
16© Tallal Elshabrawy
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
17© Tallal Elshabrawy
Sending IP Packets over LANs
cleo.guc.edu.egRouter CARP Message:
What is the MAC address of 1.4?
ARP Message:IP Address 1.4 corresponds to MAC address 3f
Router C CNN.com
ARP Message:What is the MAC address of 2.3?
ARP Message:IP Address 2.3 corresponds to MAC address 1g
18© Tallal Elshabrawy
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)
19© Tallal Elshabrawy
HTTP
TCP
IP
EthernetEthernet Ethernet
IP
Router C
1.4
Router C2.3
HTTP
TCP
IP
Ethernet
Cleo.guc.edu.eg
Summary: Sending the TCP Request
Send HTTP Request to CNN.com
Establish a connection to 2.3 at port 80Open TCP connection to 2.3 port 80
Send a datagram (which contains a connection request) to 2.3Send IP datagram to 2.3
Send Ethernet frame to 3f
Send Ethernet frame to 1g
Send IP data-gram to 2.3
Send the datagram to 2.3
Frame is an IP datagram
IP datagram is a TCP segment for port 80
CNN.com
Send the datagram to 1.4
Frame is an IP datagram
20© Tallal Elshabrawy
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
Internet
How the layers work together
“Communications Networks 2nd Edition”, A. Leon-Garcia, and I. Widjaja, McGraw Hill, 2003
21© Tallal Elshabrawy
Ethereal windowsTop Pane
shows frame/packet
sequence
Middle Pane shows
encapsulation for a given frame
Bottom Pane shows hex & text“Communications Networks 2nd Edition”, A. Leon-Garcia, and I. Widjaja, McGraw Hill, 2003
22© Tallal Elshabrawy
Top pane: frame sequenceDNS
Query
TCP Connection
SetupHTTP
Request & Response
“Communications Networks 2nd Edition”, A. Leon-Garcia, and I. Widjaja, McGraw Hill, 2003
23© Tallal Elshabrawy
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
24© Tallal Elshabrawy
Middle pane: Encapsulation
IP Packet
IP Source and Destination Addresses
Protocol Type
And a lot of other stuff!
“Communications Networks 2nd Edition”, A. Leon-Garcia, and I. Widjaja, McGraw Hill, 2003
25© Tallal Elshabrawy
Middle pane: Encapsulation
TCP Segment
Source and Destination Port
Numbers
HTTP Request
GET
“Communications Networks 2nd Edition”, A. Leon-Garcia, and I. Widjaja, McGraw Hill, 2003