0% found this document useful (0 votes)
13 views40 pages

Protocol TCP IP

The document provides an overview of TCP/IP internetworking, detailing the protocol family including IP, TCP, and UDP, and their roles in data transmission. It explains the structure of the internet, the importance of protocol architecture, and the three-layer model of data communications. Additionally, it covers addressing, packet encapsulation, and the differences between TCP and UDP, highlighting their applications and functionalities.

Uploaded by

sethupathi.sn
Copyright
© © All Rights Reserved
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)
13 views40 pages

Protocol TCP IP

The document provides an overview of TCP/IP internetworking, detailing the protocol family including IP, TCP, and UDP, and their roles in data transmission. It explains the structure of the internet, the importance of protocol architecture, and the three-layer model of data communications. Additionally, it covers addressing, packet encapsulation, and the differences between TCP and UDP, highlighting their applications and functionalities.

Uploaded by

sethupathi.sn
Copyright
© © All Rights Reserved
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/ 40

Introduction to TCP/IP

Internetworking
• Interconnected networks, usually implies
TCP/IP
• Can appear to users as a single large
network
• The global Internet is the largest example,
but intranets and extranets are also
examples
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 (nodes) are devices on multiple
networks that pass traffic between them
• Individual networks pass traffic from
one router or endpoint to another
Why Use Protocol Architecture?
• Data communications requires complex
procedures
– Sender identifies data path/receiver
– Systems negotiate preparedness
– Applications negotiate preparedness
– Translation of file formats
• For all tasks to occur, high level of
cooperation is required
What is a Protocol?
• Allows entities (i.e. application programs)
from different systems to communicate
• Shared conventions for communicating
information are called protocols
• Includes syntax, semantics, and timing
Three-Layer Model
• Distributed data communications involves three
primary components:
– Networks
– Computers
– Applications
• Three corresponding layers
– Network access layer
– Transport layer
– Application layer
Network Access Layer
• Concerned with exchange of data between
computer and network
• Includes addressing, routing, prioritizing,
etc
• Different networks require different
software at this layer
• Example: X.25 standard for network access
procedures on packet-switching networks
Transport Layer
• Concerned with reliable transfer of
information between applications
• Independent of the nature of the application
• Includes aspects like flow control and error
checking
Application Layer
• Logic needed to support various
applications
• Each type of application (file transfer,
remote access) requires different software
on this layer
Data Transmission
• Application layer creates data block
• Transport layer appends header to create PDU
(protocol data unit)
– Destination SAP, Sequence #, Error-Detection Code
• Network layer appends another header
– Destination computer, facilities (e.g. “priority”)
• See figure 4.5 in the book
Protocol Architecture Operation
TCP/IP Network Model
• Different view – 4 layers
– Layer 1 : Link (we did not look at details)
– Layer 2 : Network
– Layer 3 : Transport
– Layer 4 : Application
OSI: Open Systems Interconnect

OSI Model

7th
OSI and Protocol Stack
TCP/IP Hierarchy Protocols

Application Layer

6th
Presentation Application
Layer Layer
5th
Session Layer

4th
Transport
Transport Layer
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
Figure 2.16 TCP/IP and OSI model

2.16
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
Addressing
• Each computer on a network requires a
unique address on that network
• Each application requires a unique address
within the computer to allow support for
multiple applications (service access points,
or SAP)
ADDRESSING
Four levels of addresses are used in an internet
employing the TCP/IP protocols: physical, logical, port,
and specific.

Physical Addresses
Logical Addresses
Port Addresses
Specific Addresses
Most local-area networks use a 48-bit (6-byte)
physical address written as 12 hexadecimal digits;
07:01:02:01:2C:4B

The physical addresses will change from hop to hop,


but the logical addresses usually remain the same.
Figure 2.17 Addresses in TCP/IP

2.20
Example 2.4

Figure 2.21 shows two computers communicating


via the Internet. The sending computer is running
three processes at this time with port addresses a, b,
and c. The receiving computer is running two
processes at this time with port addresses j and k.
Process a in the sending computer needs to
communicate with process j in the receiving
computer. Note that although physical addresses
change from hop to hop, logical and port addresses
remain the same from the source to destination.

2.21
Figure 2.21 Port addresses

2.22
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
Internet Protocol
• IP stands for Internet Protocol
• IP specifies the format of packets, also
called datagrams, and the addressing
scheme.
• Most networks combine IP with a higher-
level protocol called Transmission
Control Protocol (TCP)
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
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

We only looked at the IP addresses, TTL and protocol #


Source IP Routing 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
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 (used to order packets)
• Acknowledgement number (used to verify
packets are received)
0 4
TCP Segment
10 16 19 24 31
Source Port Destination Port
Sequence Number
Acknowledgment Number
Len Reserved Flags Window
Checksum Urgent Pointer
Options... Padding
Data...
Field Purpose
Source Port Identifies originating application
Destination Port Identifies destination application
Sequence Number Sequence number of first octet in the segment
Acknowledgment # Sequence number of the next expected octet (if ACK flag set)
Len Length of TCP header in 4 octet units
Flags TCP flags: SYN, FIN, RST, PSH, ACK, URG
Window Number of octets from ACK that sender will accept
Checksum Checksum of IP pseudo-header + TCP header + data
Urgent Pointer Pointer to end of “urgent data”
Options Special TCP options such as MSS and Window Scale

You just need to know port numbers, seq and ack are added
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

You might also like