Escolar Documentos
Profissional Documentos
Cultura Documentos
Introduction to TCP/IP
Jaimon Jacob
Asst. Professor in CS
TCP/IP Hierarchy
Protocols
7th
Application Layer
6th
Presentation Layer
Application Layer
5th
Session Layer
4th
Transport Layer
Transport Layer
3rd
Network Layer
Network Layer
2nd
Link Layer
1st
Physical Layer
Link Layer
Link Layer
: includes device driver and network interface card
Network Layer
: handles the movement of packets, i.e. Routing
Transport Layer : provides a reliable flow of data between two hosts
Application Layer : handles the details of the particular application
Packet Encapsulation
The data is sent down the protocol stack
Each layer adds to the data by prepending headers
4Bytes
Ethernet
Computer <-> Computer communication on
same network
Each device has unique MAC address (48-bit)
example: 00-C0-4F-48-47-93
Ethernet Packet:
Preamble
Dest.
address
Source
address
Type
8bytes
6bytes
6bytes
2bytes
Data
CRC
64 - 1500bytes
4bytes
ARP cache
maintains the recent mappings from IP addresses to MAC addresses
Protocol
1. ARP request broadcast on Ethernet
2. Destination host ARP layer responds
IP header:
1 :ICMP
6 :TCP
17 :UDP
0123
4567
11
8901
1111
2345
1111
6789
2222
0123
2222
4567
2233
8901
IP Routing
Source
Destination
Application
Application
Transport
Router
Transport
Network
Network
Network
Link
Link
Link
Routing Table
Destination IP address
IP address of a next-hop router
Flags
Network interface specification
4bytes
ICMP
Header
ICMP
Data
Protocol
1. Set up connection
2. Transfer data
3. Close connection
1
0
1
1
1
2
1
3
1
4
1
5
1
6
1
7
1
8
1
9
2
0
Source Port
2
1
2
2
2
3
2
4
2
5
Destination Port
Sequence Number
Acknowledgement Number
Data
Offset
Window
Checksum
Urgent Pointer
Options (0 to 10 Words of 32 Bits)
TCP Payload
2
6
2
7
2
8
2
9
3
0
3
1
10
11
TCP : Connection
Client
Host
Receive SYN
+ACK segment
Client
Host
12
Timer
Send Packet 1
Start Timer
ACK would normally
Arrive at this time
Host
Packet Lost
Time Expires
Timer
Retransmit Packet1
Start Timer
Receive ACK 1
Cancel Timer
Receive Packet 1
Send AXK 1
13
HTTP
Common Request Methods
GET, PUT, POST
Response Categories
Informational
:100
Successful
:200
Redirection
:300
Client Error
:400 (eg. 404 Not found)
Server Error
:500
14
15
Client
Appl
HTTP
Transp
TCP
Http request
GET http://www.ee.ucla.edu<CR>
Http response
200 <CR> <html file in MIME format>
Initiate connection (hdshk)
Package data (add TCP header)
send http request packet
Assemble response
(break into several packets)
Send http response packets
Appl
HTTP
Transp
TCP
Net
IP
Link
ethernet
Relay data
Net
IP
Link
ethernet
Router(s)
Net
IP
Link
ethernet
References
TCP/IP Illustrated, Volume 1 The Protocols
by W. Richard Stevens (http://yenigul.net/tcpip)
Internet Working with TCP/IP Volume 1
by Douglas E. Comer
16