0% found this document useful (0 votes)
60 views17 pages

Introduction To TCP/IP: Vikyath M.B

1) The document introduces the TCP/IP protocol stack and compares it to the OSI model. It describes the layers of each model including the physical, link, network, transport, and application layers. 2) Packet encapsulation is explained where each layer in the stack adds a header to the data being passed down. 3) Key protocols of each layer are defined including Ethernet, ARP, IP, ICMP, TCP, UDP, and HTTP. Common network concepts such as IP routing, TCP connection establishment and data transfer are summarized.

Uploaded by

vikyath4488
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
60 views17 pages

Introduction To TCP/IP: Vikyath M.B

1) The document introduces the TCP/IP protocol stack and compares it to the OSI model. It describes the layers of each model including the physical, link, network, transport, and application layers. 2) Packet encapsulation is explained where each layer in the stack adds a header to the data being passed down. 3) Key protocols of each layer are defined including Ethernet, ARP, IP, ICMP, TCP, UDP, and HTTP. Common network concepts such as IP routing, TCP connection establishment and data transfer are summarized.

Uploaded by

vikyath4488
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 17

1

Introduction to TCP/IP

VIKYATH M.B
2
OSI and Protocol Stack OSI: Open Systems Interconnect

OSI Model 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
Link Layer
1st
Physical 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
3
Packet Encapsulation
 The data is sent down the protocol stack
 Each layer adds to the data by prepending headers

22Bytes 20Bytes 20Bytes 4Bytes

64 to 1500 Bytes
4
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. Source Type Data CRC
address address

8bytes 6bytes 6bytes 2bytes 64 - 1500bytes 4bytes

MAC: Media Access Control


5
ARP : Address Resolution Protocol
 ARP provides mapping
32bit IP address <-> 48bit MAC address
128.97.89.153 <-> 00-C0-4F-48-47-93
 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
6
IP: Internet Protocol
 Unreliable … connectionless datagram delivery service
 Responsible for routing of data through intermediate
networks and computers

11 1111 1111 2222 2222 2233


IP header: 0123 4567 8901 2345 6789 0123 4567 8901

1 :ICMP
6 :TCP
17 :UDP
7
8
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
9
ICMP : Internet Control Message Protocol
 Used to report problems with delivery of IP Datagrams
within an IP network
 Used by Ping, Tracerout commands
ICMP Message
20bytes 4bytes

IP ICMP ICMP
Header Header Data

Types and Codes


 Echo Request (type=8, code=0) Type Code Checksum

 Echo Reply(type=0, code=0) 1byte 1byte 2bytes

 Destination Unreachable(type=3, code=0)

 Time Exceeded(type=11, code=0) : Time-to-Live =0


10
TCP : Transmission Control Protocol
 Connection-Oriented, Reliable, Byte Stream Service
Protocol
1. Set up connection
2. Transfer data
3. Close connection

TCP Header Format


0 1 2 3 4 5 6 7 8 9 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 3 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
Source Port Destination Port
Sequence Number
Acknowledgement Number
- - - -
Data Window
Offset
               
Checksum
                        Urgent Pointer
                       
                       
     
Options
     
(0 to 
10
 
Words of 32 Bits)
TCP Payload
 
11
TCP : State Diagram
12
TCP : Connection

Client Host Client Host

Send SYN seq=x Send FIN seq=x


Receive SYN segment Receive FIN segment
Send SYN seq=y, Send ACK x+1
Receive ACK segment
Receive SYN ACK x+1
+ACK segment Send FIN seq=y,
Receive FIN ACK x+1
+ ACK segment
Send ACK y+1
Send ACK y+1
Receive ACK segment Receive ACK segment

Establishing a TCP Connection Closing a TCP Connection


13
TCP : Data transfer

Client Host

Send Packet 1
Start Timer Packet Lost Packet should arrive
Timer ACK should be sent
ACK would normally
Arrive at this time

Time Expires

Retransmit Packet1
Timer Start Timer Receive Packet 1
Send ACK 1
Receive ACK 1
Cancel Timer
14
HTTP : Hyper Text Transfer Protocol

 Stateless Transaction Protocol


Each transaction creates a new connection
Steps in Transaction
1. Establish connection
2. Request
Method <URL> <CR>
3. Response
Response Code <Data> <CR>
4. Close connection
15
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
16
Example: Access www.ee.ucla.edu

Client Server
Http request
Appl GET “http://www.ee.ucla.edu”<CR> Appl
Http response
HTTP 200 “” <CR> <html file in MIME format> HTTP
Transp Initiate connection (hdshk) Transp
Package data (add TCP header)
send http request packet
TCP Assemble response TCP
(break into several packets)
Send http response packets
Close connection (hdshk)
send data to next hop
Net Net Net
Relay data
IP ARP to provide IP IP
IP/MAC translation
Link Link Link
ethernet ethernet ethernet
Router(s)
17
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)

You might also like