Introduction To TCP - IP
Introduction To TCP - IP
Introduction to TCP/IP
TCP/IP Hierarchy
Protocols
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
64 to 1500 Bytes
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
6bytes
Source address
6bytes
Type
Data
CRC
8bytes
2bytes
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
0123
4567
11 8901
1111 2345
1111 6789
2222 0123
2222 4567
2233 8901
IP Routing
Source
Application
Destination
Application
Transport
Network Link
Router
Network Link
Routing Table Destination IP address IP address of a next-hop router Flags Network interface specification
Types and Codes Type Code Checksum Echo Request (type=8, code=0) 1byte 1byte 2bytes Echo Reply(type=0, code=0) Destination Unreachable(type=3, code=0) Time Exceeded(type=11, code=0) : Time-to-Live =0
Destination Port
Checksum
10
TCP : Connection
11
Host
Host
Receive ACK segment Receive FIN + ACK segment Send ACK y+1
Receive FIN segment Send ACK x+1 Send FIN seq=y, ACK x+1 Receive ACK segment
12
Timer
Timer
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
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 Sams Teach Yourself TCP/IP in 24 Hours by Joe Casad. Published by Sams. (http://www.informit.com)
16