0% found this document useful (0 votes)
7 views30 pages

Introduction To TCPnIP

The document provides an overview of the TCP/IP protocol family, detailing its structure, including the Internet Protocol (IP), Transmission Control Protocol (TCP), and User Datagram Protocol (UDP). It compares the TCP/IP model with the OSI model, highlighting the differences in layers and reliability, and explains key concepts such as packet encapsulation, routing, and IP addressing. Additionally, it covers the roles of protocols like ARP and DHCP in network communication.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views30 pages

Introduction To TCPnIP

The document provides an overview of the TCP/IP protocol family, detailing its structure, including the Internet Protocol (IP), Transmission Control Protocol (TCP), and User Datagram Protocol (UDP). It compares the TCP/IP model with the OSI model, highlighting the differences in layers and reliability, and explains key concepts such as packet encapsulation, routing, and IP addressing. Additionally, it covers the roles of protocols like ARP and DHCP in network communication.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 30

Introduction to TCP/IP

IT31013 - Network Performance


Analysis
TCP/IP protocol family
• IP : Internet Protocol
– UDP : User Datagram Protocol
• RTP, traceroute
– TCP : Transmission Control Protocol
• HTTP, FTP, ssh
What is an Internet?
• A set of interconnected networks
• The Internet is the most famous
example

• Networks can be completely different


– Ethernet, ATM, modem, …
– (TCP/)IP is what links them
What is an Internet? (cont)
• Routers are devices on multiple
networks that pass traffic between them
• Individual networks pass traffic from
one router or endpoint to another
• TCP/IP hides the details as much as
possible
ISO/OSI Network Model
• Seven network “layers”
– Layer 1 : Physical – cables
– Layer 2 : Data Link – ethernet
– Layer 3 : Network – IP
– Layer 4 : Transport – TCP/UDP
– Layer 5 : Session
– Layer 6 : Presentation
– Layer 7 : Application

You don’t need to know the layers just the idea that it is layered
TCP/IP Network Model
• Different view – 5 layers
– Layer 1 : Physical
– Layer 2 : Link
– Layer 3 : Network
– Layer 4 : Transport
– Layer 5 : Application
TCP/IP Network Model
A Comparison of the OSI and TCP/IP Reference
Models
A Comparison of the OSI and TCP/IP Reference
Models
Both are based on the concept of a stack of independent
protocols. Also, the functionality of the layers is roughly
similar.

For example, in both models the layers up through and


including the transport layer are there to provide an end-to-
end, net-work-independent transport service to processes
wishing to communicate. These layers form the transport
provider. Again in both models, the layers above transport
are application-oriented users of the transport service.
A Comparison of the OSI and TCP/IP Reference
Models

The OSI model is a “generic, protocol-independent standard”.
The TCP/IP are regarded as the standard around which the
internet has developed.

TCP/IP is a simple model because of fewer layers (five) as
compare to OSI that defined seven layers in original version.

TCP/IP is more reliable model as compare to OSI model
because the Internet was developed around it.

The OSI model is bottom to up process of network connection
whereas the TCP/IP is the top to bottom process structure for
Internet purpose.

The TCP/IP combines the OSI data link and physical into
network access layer.

OSI model is a reference model while TCP/IP is an
implementation of OSI model.
Packet Encapsulation
 The data is sent down the protocol stack
 Each layer adds to the data by prepending headers

22Bytes20Bytes20Bytes 4Bytes

64 to 1500 Bytes
IP
• Responsible for end to end transmission
• Sends data in individual packets
• Maximum size of packet is determined
by the networks
– Fragmented if too large
• Unreliable
– Packets might be lost, corrupted,
duplicated, delivered out of order
IP addresses
• 4 bytes
– e.g. 163.1.125.98
– Each device normally gets one (or more)
– In theory there are about 4 billion available

• But…
Routing
• How does a device know where to send
a packet?
– All devices need to know what IP
addresses are on directly attached
networks
– If the destination is on a local network,
send it directly there
Routing (cont)
• If the destination address isn’t local
– Most non-router devices just send
everything to a single local router
– Routers need to know which network
corresponds to each possible IP address
Allocation of addresses
• Controlled centrally by ICANN
– Fairly strict rules on further delegation to
avoid wastage
• Have to demonstrate actual need for them
• Organizations that got in early have
bigger allocations than they really need
IP packets
• Source and destination addresses
• Protocol number
– 1 = ICMP, 6 = TCP, 17 = UDP
• Various options
– e.g. to control fragmentation
• Time to live (TTL)
– Prevent routing loops
0 4
IP Datagram
8 16 19 24 31
Vers Len TOS Total Length
Identification Flags Fragment Offset
TTL Protocol Header Checksum
Source Internet Address
Destination Internet Address
Options... Padding
Data...

Field Purpose Field Purpose


Vers IP version number TTL Time To Live - Max # of hops
Len Length of IP header (4 octet units) Protocol Higher level protocol (1=ICMP,
TOS Type of Service 6=TCP, 17=UDP)
T. Length Length of entire datagram (octets) Checksum Checksum for the IP header
Ident. IP datagram ID (for frag/reassembly) Source IA Originator’s Internet Address
Flags Don’t/More fragments Dest. IA Final Destination Internet Address
Frag Off Fragment Offset Options Source route, time stamp, etc.
Data... Higher level protocol data

You just need to know the IP addresses, TTL and protocol #


UDP
• Thin layer on top of IP
• Adds packet length + checksum
– Guard against corrupted packets
• Also source and destination ports
– Ports are used to associate a packet with a
specific application at each end
• Still unreliable:
– Duplication, loss, out-of-orderness possible
UDP datagram
0 16 31
Source Port Destination Port
Length Checksum
Application data

Field Purpose
Source Port 16-bit port number identifying originating application
Destination Port 16-bit port number identifying destination application
Length Length of UDP datagram (UDP header + data)
Checksum Checksum of IP pseudo header, UDP header, and data
Typical applications of UDP
– Where packet loss etc is better handled by
the application than the network stack
– Where the overhead of setting up a
connection isn’t wanted

• VOIP
• NFS – Network File System
• Most games
TCP
• Reliable, full-duplex, connection-
oriented, stream delivery
– Interface presented to the application
doesn’t require data in individual packets
– Data is guaranteed to arrive, and in the
correct order without duplications
• Or the connection will be dropped
– Imposes significant overheads
Applications of TCP
• Most things!
– HTTP, FTP, …

• Saves the application a lot of work, so


used unless there’s a good reason not
to
TCP implementation
• Connections are established using a
three-way handshake
• Data is divided up into packets by the
operating system
• Packets are numbered, and received
packets are acknowledged
• Connections are explicitly closed
– (or may abnormally terminate)
TCP Packets
• Source + destination ports
• Sequence number
• Acknowledgement number
• Checksum
• Various options
TCP : Data transfer
Clien Host
t
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 AXK 1
Receive ACK 1
Cancel Timer
IPv6
• 128 bit addresses
– Make it feasible to be very wasteful with
address allocations
• Lots of other new features
– Built-in autoconfiguration, security options,

• Not really in production use yet
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 Contro


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
DHCP
• Dynamic Host Configuration Protocol
– Used to tell a computer what IP address to use
– Device broadcasts a request from IP 0.0.0.0
• If it had an IP address before, asks for the same one
again
– Server (or relay) on local network responds telling
it which to use (or ignores it, or tells it go away)
• “Lease time” telling it how long that IP will be valid for
• Device requests renewal of lease after ¾(?) elapsed

You might also like