SlideShare a Scribd company logo
Reliable Transport Service
TCP/IP
OSI Model TCP/IP Hierarchy Protocols
7th
Application Layer
6th
Presentation Layer
5th
Session Layer
4th
Transport Layer
3rd
Network Layer
2nd
Link Layer
1st
Physical Layer
Application Layer
Transport Layer
Network Layer
Link Layer
OSI v/s TCP/IP
Transmission Control Protocol
(TCP)
 Major transport service in the TCP/IP suite
 Used for most Internet applications (esp. World Wide Web)
Connection-oriented protocol
Provides a reliable unicast end-to-end byte stream over an unreliable
internetwork.
Very complex
• Specifies format of data and acks
• Specifies how TCP software distinguishes among multiple destinations on a host
• How hosts recover from lost or duplicated packets
• How hosts initiate and terminate a transfer TCP
IP Internetwork
ByteStream
ByteStream
TCP
TCP Characteristics
 Stream orientation
 Virtual circuit connection
 Buffered transfer
 Unstructured stream
 Full duplex connection
 Reliability
Providing Reliability
Traditional technique: Positive Acknowledgement with
Retransmission (PAR)
• Receiver sends acknowledgement when data arrives
• Sender starts timer whenever transmitting
• Sender retransmits if timer expires before
• acknowledgement arrives
Illustration Of Sliding Window
Window size is fixed
As acknowledgement arrives, window moves forward
 Why Sliding Window Works
Because a well-tuned sliding window protocol keeps
the network completely saturated with packets, it obtains
substantially higher throughput than a simple positive
acknowledgement protocol.
Illustration Of Sliding Window
Conceptual Layering Layering Of The Three
Major Protocols
Application
Reliable Stream (TCP) User Datagram (UDP)
Internet (IP)
Network Interface
Ports, Connections, and Endpoints
Like UDP, TCP resides in the transport layer
Like UDP, TCP uses protocol port numbers to identify
the ultimate destination within a host
TCP ports are much more complex than UDP ports
TCP port numbers do not correspond to a single object.
TCP is built on the connection abstraction, in which
objects are identified by connections.
A connection is a pair of endpoints.
An endpoint is a pair, (host, port).
Two connections might share one endpoint.
TCP connection between two endpoints identified by
four items
 Sender’s IP address
 Sender’s protocol port number
 Receiver’s IP address
 Receiver’s protocol port number
An Important Idea About Port Numbers
• Because TCP identifies a connection by a pair of
endpoints, a given TCP port number can be shared by
multiple connections on the same machine.
Passive And Active Opens
Two sides of a connection
 One side waits for contact
• A server program
• Uses TCP’s passive open
One side initiates contact
• A client program
• Uses TCP’s active open
Passive and Active Opens(cntd)
• An application program on one end performs a passive open by
indicating to the OS that it will accept an incoming connection. The OS
provides a TCP port number for its end of the connection.
• An application program on the other end uses an active open request a
connection.
• The two TCP software modules communicate to establish and verify
a connection.
• Once the connection is established, the application programs begin
to pass data.
• TCP modules at each end guarantee reliable delivery.
Segments, Streams, and Sequence Numbers
TCP views the data as a sequence of octets that it divides into segments.
Usually, each segment travels in a single IP datagram.
TCP uses a specialized sliding window mechanism to solve two
problems: efficient transmission and flow control.
TCP allows the receiver to restrict transmission until it has sufficient
buffer space to accommodate more data.
The sliding window mechanism operates the octet level. A sender keeps
three pointers associated with each connection.
TCP software at each end maintains two windows per connection
for a total of four.
 One slides as data is sent, the other as data is
received.
Variable Window Size and Flow Control
TCP allows the window size to vary over time. Each ack contains a
window advertisement that specifies how many octets of data the
receiver is prepared to accept.
This provides flow control. The window size may even be zero.
When intermediate machines become overloaded, the condition is
called congestion, and mechanisms to solve the problem are called
congestion control mechanisms.
Solves two independent problems.
• A hand-held PDA communicating with a fast PC may be overrun.
•A mechanism is needed to allow intermediate systems (routers) to
control a source that sends more traffic than the system can tolerate.
TCP Segment Format
IP header TCP header TCP data
Sequence number (32 bits)
DATA
20 bytes 20 bytes
0 15 16 31
Source Port Number Destination Port Number
Acknowledgement number (32 bits)
window size
header
length
0 Flags
Options (if any)
TCP checksum urgent pointer
20bytes
Port Number:
• A port number identifies the endpoint of a connection.
• A pair <IP address, port number> identifies one
endpoint of a connection.
• Two pairs <client IP address, server port
number> and <server IP address, server port
number> identify a TCP connection.
TCP
IP
Applications
23 10480Ports:
TCP
IP
Applications
7 1680 Ports:
Sequence Number (SeqNo):
• Sequence number is 32 bits long.
• So the range of SeqNo is
0 <= SeqNo <= 232 -1  4.3 Gbyte
• Each sequence number identifies a byte in the byte stream
• Initial Sequence Number (ISN) of a connection is set during
connection establishment
Acknowledgement Number (AckNo):
• Acknowledgements are piggybacked, I.e a segment from A -> B
can contain an acknowledgement for a data sent in the B -> A
direction
18
• A hosts uses the AckNo field to send acknowledgements. (If a host
sends an AckNo in a segment it sets the “ACK flag”)
• The AckNo contains the next SeqNo that a hosts wants to receive
Example: The acknowledgement for a segment with
sequence numbers 0-1500 is AckNo=1501
• TCP uses the sliding window flow protocol (see CS 457) to
regulate the flow of traffic from sender to receiver
• TCP uses the following variation of sliding window:
ono NACKs (Negative ACKnowledgement)
oonly cumulative ACKs
19
Header Length ( 4bits):
• Length of header in 32-bit words
• Note that TCP header has variable length (with minimum 20
bytes)
Flag bits:
• URG: Urgent pointer is valid
oIf the bit is set, the following bytes contain an urgent message in the
range:
oSeqNo <= urgent message <= SeqNo+urgent pointer
• ACK: Acknowledgement Number is valid
• PSH: PUSH Flag
oNotification from sender to the receiver that the receiver should pass all
data that it has to the application.
oNormally set by sender when the sender’s buffer is empty
• RST: Reset the connection
oThe flag causes the receiver to reset the connection
oReceiver of a RST terminates the connection and indicates
higher layer application about the reset
• SYN: Synchronize sequence numbers
oSent in the first packet when initiating a connection
• FIN: Sender is finished with sending
oUsed for closing a connection
oBoth sides of a connection must send a FIN
TCP Checksum:
• TCP checksum covers over both TCP header and TCP data (also
covers some parts of the IP header)
21
• Window Size:
• Each side of the connection advertises the window size
• Window size is the maximum number of bytes that a receiver can
accept.
• Maximum window size is 216-1= 65535 bytes
• Urgent Pointer:
• Only valid if URG flag is set
• Options:
End of
Options kind=0
1 byte
NOP
(no operation) kind=1
1 byte
Maximum
Segment Size
kind=2
1 byte
len=4
1 byte
maximum
segment size
2 bytes
Window Scale
Factor kind=3
1 byte
len=3
1 byte
shift count
1 byte
Timestamp kind=8
1 byte
len=10
1 byte
timestamp value
4 bytes
timestamp echo reply
4 bytes
23
• Options:
• NOP is used to pad TCP header to multiples of 4 bytes
• Maximum Segment Size
• Window Scale Options
oIncreases the TCP window from 16 to 32 bits, I.e., the
window size is interpreted differently
oThis option can only be used in the SYN segment (first
segment) during connection establishment time
• Timestamp Option
oCan be used for roundtrip measurements
Connection Setup
• The client sends a synchronisation (SYN) packet
specifying
• The port number of the server
• The clients initial sequence number
• The server responds with its own SYN segment,
which specifies its initial sequence number (ISN).
The server also acknowledges the clients SYN. This
segment is called a SYN,ACK.
• The client must acknowledge the SYN from the
server by acking the server’s ISN.
• This is called a three way handshake
• Host A performs an Active Open
• Host B performs a Passive Open
• Both sides agree on initial sequence numbers
• Both sides advertise initial window sizes
• Both sides are now ready to transfer data
send
SYN
seq=x
receive SYN
segment
send SYN
seq=y,
ACK x+1
receive
SYN +ACK
segment
send ACK
y+1
receive ACK
segment
host A host B
Connection Closure
• It takes four segments to terminate a
connection
• Each direction of data flow is closed separately.
• It is possible for a TCP connection to be half closed
• Finish segments are issued as a result of an
application close
• ACKs of FIN segments are issued by TCP
without reference to the application
• Host A performs an active close
• Host B performs a passive close
• FIN of A is ACKed immediately by TCP
• Host B only issues its own FIN when the application
has reacted to receipt of the first FIN, by issuing a
send
FIN
seq=x
receive FIN
segment
receive
FIN +ACK
segment
send ACK
y+1
receive ACK
segment
host A host B
receive ACK
segment
send ACK
x+1
send
FIN seq=y,
ACKx+1
TCP State Transitions
• Each TCP connection keeps a record of its state, which allows the
connection to progress through several transitions until closure
• The state transitions facilitate connection set up and termination
• All data transfer takes place within the Established state.
Starting Point
Normal transitions for a server
Active open
recv: FIN
recv: ACK
send: FIN
recv: FIN
Normal transitions for a client
State
SYN_RCVD
LISTEN
ESTABLISHED
SYN_SENT
CLOSE_WAIT
LAST_ACK
FIN_WAIT_1
FIN_WAIT_2 TIME_WAIT
Key
Active Close
Passive Close
CLOSED
send: ACK
appl: passive open
Data transfer state
2MSL timeout
Name of the TCP state
appl: transition undertaken when application issues operation
recv: transition undertaken when segment received
send: what is sent for this transition
Passive Open
CLOSING
Starting Point
Normal transitions for a server
Active open
recv: FIN send:ACK
recv: ACK
Normal transitions for a client
State
SYN_RCVD
LISTEN
ESTABLISHED
SYN_SENT
CLOSE_WAIT
LAST_ACK
FIN_WAIT_1
FIN_WAIT_2 TIME_WAIT
Key
Active Close
Passive Close
CLOSED
Data transfer state
2MSL timeout
Name of the TCP state
appl: transition undertaken when application issues operation
recv: transition undertaken when segment received
send: what is sent for this transition
CLOSING
Starting Point
Normal transitions for a server
Active open
recv: FIN send:ACK
recv: ACK
send: FIN
recv: FIN
recv: ACK
Normal transitions for a client
State
SYN_RCVD
LISTEN
ESTABLISHED
SYN_SENT
CLOSE_WAIT
LAST_ACK
FIN_WAIT_1
FIN_WAIT_2 TIME_WAIT
Key
Active Close
Passive Close
CLOSED
send: ACK
appl: passive open
Data transfer state
2MSL timeout
Name of the TCP state
appl: transition undertaken when application issues operation
recv: transition undertaken when segment received
send: what is sent for this transition
Passive Open
CLOSING
Starting Point
Normal transitions for a server
simultaneous open
send: SYN,ACK
recv: SYN
Active open
simultaneous close
recv: FIN send:ACK
recv: FIN
send: ACK
recv: ACK
send: FIN
recv: FIN
send: FIN
recv: ACK recv: ACK
Normal transitions for a client
State
SYN_RCVD
LISTEN
ESTABLISHED
SYN_SENT
CLOSE_WAIT
LAST_ACK
CLOSINGFIN_WAIT_1
FIN_WAIT_2 TIME_WAIT
Key
Active Close
Passive Close
TCP State Transitions
CLOSED
send: ACK
appl: passive open
appl: close
Data transfer state
2MSL timeout
appl: close
or timeout
Name of the TCP state
appl: transition undertaken when application issues operation
recv: transition undertaken when segment received
send: what is sent for this transition
Passive Open
TCP/IP

More Related Content

What's hot

Application layer protocols
Application layer protocolsApplication layer protocols
Application layer protocols
JUW Jinnah University for Women
 
Arp and rarp
Arp and rarpArp and rarp
Arp and rarpMohd Arif
 
Protocols and the TCP/IP Protocol Suite
Protocols and the TCP/IP Protocol SuiteProtocols and the TCP/IP Protocol Suite
Protocols and the TCP/IP Protocol Suite
Atharaw Deshmukh
 
Lesson 6: Dynamic Host Configuration Protocol A
Lesson 6: Dynamic Host Configuration Protocol ALesson 6: Dynamic Host Configuration Protocol A
Lesson 6: Dynamic Host Configuration Protocol A
Mahmmoud Mahdi
 
TCP - IP Presentation
TCP - IP PresentationTCP - IP Presentation
TCP - IP Presentation
Harish Chand
 
TCP/IP Protocol Architeture
TCP/IP Protocol ArchitetureTCP/IP Protocol Architeture
TCP/IP Protocol Architeture
Manoj Kumar
 
Distributed system architecture
Distributed system architectureDistributed system architecture
Distributed system architecture
Yisal Khan
 
Introduction to Shell script
Introduction to Shell scriptIntroduction to Shell script
Introduction to Shell script
Bhavesh Padharia
 
Socket programming or network programming
Socket programming or network programmingSocket programming or network programming
Socket programming or network programming
Mmanan91
 
Presentation on arp protocol
Presentation on arp protocolPresentation on arp protocol
Presentation on arp protocol
Mohd. Ahmad Siddiqi
 
TCP-IP Reference Model
TCP-IP Reference ModelTCP-IP Reference Model
TCP-IP Reference Model
Mukesh Tekwani
 
TCP and UDP
TCP and UDP TCP and UDP
TCP and UDP
Ramesh Giri
 
Socket programming
Socket programmingSocket programming
Socket programming
chandramouligunnemeda
 
Dns presentation
Dns presentationDns presentation
Dns presentation
Anurag Pandey
 
Ports & sockets
Ports  & sockets Ports  & sockets
Ports & sockets
myrajendra
 
TCP & UDP ( Transmission Control Protocol and User Datagram Protocol)
TCP & UDP ( Transmission Control Protocol and User Datagram Protocol)TCP & UDP ( Transmission Control Protocol and User Datagram Protocol)
TCP & UDP ( Transmission Control Protocol and User Datagram Protocol)
Kruti Niranjan
 
5. protocol layering
5. protocol layering5. protocol layering
5. protocol layering
JAIGANESH SEKAR
 
tcp ip protocols.ppt
tcp ip protocols.ppttcp ip protocols.ppt
tcp ip protocols.ppt
ssuser3acfba
 
Network protocals
Network protocalsNetwork protocals
Network protocals
reddivarihareesh
 

What's hot (20)

Application layer protocols
Application layer protocolsApplication layer protocols
Application layer protocols
 
Arp and rarp
Arp and rarpArp and rarp
Arp and rarp
 
Arp and rarp
Arp and rarpArp and rarp
Arp and rarp
 
Protocols and the TCP/IP Protocol Suite
Protocols and the TCP/IP Protocol SuiteProtocols and the TCP/IP Protocol Suite
Protocols and the TCP/IP Protocol Suite
 
Lesson 6: Dynamic Host Configuration Protocol A
Lesson 6: Dynamic Host Configuration Protocol ALesson 6: Dynamic Host Configuration Protocol A
Lesson 6: Dynamic Host Configuration Protocol A
 
TCP - IP Presentation
TCP - IP PresentationTCP - IP Presentation
TCP - IP Presentation
 
TCP/IP Protocol Architeture
TCP/IP Protocol ArchitetureTCP/IP Protocol Architeture
TCP/IP Protocol Architeture
 
Distributed system architecture
Distributed system architectureDistributed system architecture
Distributed system architecture
 
Introduction to Shell script
Introduction to Shell scriptIntroduction to Shell script
Introduction to Shell script
 
Socket programming or network programming
Socket programming or network programmingSocket programming or network programming
Socket programming or network programming
 
Presentation on arp protocol
Presentation on arp protocolPresentation on arp protocol
Presentation on arp protocol
 
TCP-IP Reference Model
TCP-IP Reference ModelTCP-IP Reference Model
TCP-IP Reference Model
 
TCP and UDP
TCP and UDP TCP and UDP
TCP and UDP
 
Socket programming
Socket programmingSocket programming
Socket programming
 
Dns presentation
Dns presentationDns presentation
Dns presentation
 
Ports & sockets
Ports  & sockets Ports  & sockets
Ports & sockets
 
TCP & UDP ( Transmission Control Protocol and User Datagram Protocol)
TCP & UDP ( Transmission Control Protocol and User Datagram Protocol)TCP & UDP ( Transmission Control Protocol and User Datagram Protocol)
TCP & UDP ( Transmission Control Protocol and User Datagram Protocol)
 
5. protocol layering
5. protocol layering5. protocol layering
5. protocol layering
 
tcp ip protocols.ppt
tcp ip protocols.ppttcp ip protocols.ppt
tcp ip protocols.ppt
 
Network protocals
Network protocalsNetwork protocals
Network protocals
 

Similar to TCP/IP

tcp-ippresentation-150614172243-lva1-app6892.pptx
tcp-ippresentation-150614172243-lva1-app6892.pptxtcp-ippresentation-150614172243-lva1-app6892.pptx
tcp-ippresentation-150614172243-lva1-app6892.pptx
AlphaKoiSylvester
 
Transmission Control Protocol_ Computer Networks
Transmission Control Protocol_ Computer NetworksTransmission Control Protocol_ Computer Networks
Transmission Control Protocol_ Computer Networks
Manimaran A
 
Transmission control protocol ...............................
Transmission control protocol ...............................Transmission control protocol ...............................
Transmission control protocol ...............................
SwatiHans10
 
Eshcol tech solutions pvt ltd
Eshcol tech solutions pvt ltdEshcol tech solutions pvt ltd
Eshcol tech solutions pvt ltd
Ojas Kumar
 
Olumide pidan b
Olumide pidan bOlumide pidan b
Olumide pidan b
Amit Ranjan
 
Unit-4 (1).pptx
Unit-4 (1).pptxUnit-4 (1).pptx
Unit-4 (1).pptx
poonamsngr
 
TCP_NISCHAYBAHL.pptx
TCP_NISCHAYBAHL.pptxTCP_NISCHAYBAHL.pptx
TCP_NISCHAYBAHL.pptx
NischayBahl1
 
Osi model
Osi modelOsi model
Osi model
Anuj Kumar
 
Unit 5.Transport Layer.pptx
Unit 5.Transport Layer.pptxUnit 5.Transport Layer.pptx
Unit 5.Transport Layer.pptx
1136NayanSonawane
 
Transport Control Protocol
Transport Control ProtocolTransport Control Protocol
Transport Control Protocol
BIT DURG
 
lecturer3.pptx
lecturer3.pptxlecturer3.pptx
lecturer3.pptx
MdFarabiHasan
 
13_TCP_Attack.pptx
13_TCP_Attack.pptx13_TCP_Attack.pptx
13_TCP_Attack.pptx
AlmaOraevi
 
CCNA (R & S) Module 01 - Introduction to Networks - Chapter 9
CCNA (R & S) Module 01 - Introduction to Networks - Chapter 9CCNA (R & S) Module 01 - Introduction to Networks - Chapter 9
CCNA (R & S) Module 01 - Introduction to Networks - Chapter 9
Waqas Ahmed Nawaz
 
Transport protocols
Transport protocolsTransport protocols
Transport protocols
Online
 
Networking essentials lect3
Networking essentials lect3Networking essentials lect3
Networking essentials lect3
Roman Brovko
 
Transport_Layer_Protocols.pptx
Transport_Layer_Protocols.pptxTransport_Layer_Protocols.pptx
Transport_Layer_Protocols.pptx
AnkitKumar891632
 
5-LEC- 5.pptxTransport Layer. Transport Layer Protocols
5-LEC- 5.pptxTransport Layer.  Transport Layer Protocols5-LEC- 5.pptxTransport Layer.  Transport Layer Protocols
5-LEC- 5.pptxTransport Layer. Transport Layer Protocols
ZahouAmel1
 
Unit 4-Transport Layer Protocols-3.pptx
Unit 4-Transport Layer Protocols-3.pptxUnit 4-Transport Layer Protocols-3.pptx
Unit 4-Transport Layer Protocols-3.pptx
DESTROYER39
 
Unit 4-Transport Layer Protocols.pptx
Unit 4-Transport Layer Protocols.pptxUnit 4-Transport Layer Protocols.pptx
Unit 4-Transport Layer Protocols.pptx
sarosh32
 

Similar to TCP/IP (20)

tcp-ippresentation-150614172243-lva1-app6892.pptx
tcp-ippresentation-150614172243-lva1-app6892.pptxtcp-ippresentation-150614172243-lva1-app6892.pptx
tcp-ippresentation-150614172243-lva1-app6892.pptx
 
Tcp ip presentation
Tcp ip presentationTcp ip presentation
Tcp ip presentation
 
Transmission Control Protocol_ Computer Networks
Transmission Control Protocol_ Computer NetworksTransmission Control Protocol_ Computer Networks
Transmission Control Protocol_ Computer Networks
 
Transmission control protocol ...............................
Transmission control protocol ...............................Transmission control protocol ...............................
Transmission control protocol ...............................
 
Eshcol tech solutions pvt ltd
Eshcol tech solutions pvt ltdEshcol tech solutions pvt ltd
Eshcol tech solutions pvt ltd
 
Olumide pidan b
Olumide pidan bOlumide pidan b
Olumide pidan b
 
Unit-4 (1).pptx
Unit-4 (1).pptxUnit-4 (1).pptx
Unit-4 (1).pptx
 
TCP_NISCHAYBAHL.pptx
TCP_NISCHAYBAHL.pptxTCP_NISCHAYBAHL.pptx
TCP_NISCHAYBAHL.pptx
 
Osi model
Osi modelOsi model
Osi model
 
Unit 5.Transport Layer.pptx
Unit 5.Transport Layer.pptxUnit 5.Transport Layer.pptx
Unit 5.Transport Layer.pptx
 
Transport Control Protocol
Transport Control ProtocolTransport Control Protocol
Transport Control Protocol
 
lecturer3.pptx
lecturer3.pptxlecturer3.pptx
lecturer3.pptx
 
13_TCP_Attack.pptx
13_TCP_Attack.pptx13_TCP_Attack.pptx
13_TCP_Attack.pptx
 
CCNA (R & S) Module 01 - Introduction to Networks - Chapter 9
CCNA (R & S) Module 01 - Introduction to Networks - Chapter 9CCNA (R & S) Module 01 - Introduction to Networks - Chapter 9
CCNA (R & S) Module 01 - Introduction to Networks - Chapter 9
 
Transport protocols
Transport protocolsTransport protocols
Transport protocols
 
Networking essentials lect3
Networking essentials lect3Networking essentials lect3
Networking essentials lect3
 
Transport_Layer_Protocols.pptx
Transport_Layer_Protocols.pptxTransport_Layer_Protocols.pptx
Transport_Layer_Protocols.pptx
 
5-LEC- 5.pptxTransport Layer. Transport Layer Protocols
5-LEC- 5.pptxTransport Layer.  Transport Layer Protocols5-LEC- 5.pptxTransport Layer.  Transport Layer Protocols
5-LEC- 5.pptxTransport Layer. Transport Layer Protocols
 
Unit 4-Transport Layer Protocols-3.pptx
Unit 4-Transport Layer Protocols-3.pptxUnit 4-Transport Layer Protocols-3.pptx
Unit 4-Transport Layer Protocols-3.pptx
 
Unit 4-Transport Layer Protocols.pptx
Unit 4-Transport Layer Protocols.pptxUnit 4-Transport Layer Protocols.pptx
Unit 4-Transport Layer Protocols.pptx
 

More from Anju Kanjirathingal

Java withrealworldtechnology
Java withrealworldtechnologyJava withrealworldtechnology
Java withrealworldtechnology
Anju Kanjirathingal
 
resolution in the propositional calculus
resolution in the propositional calculusresolution in the propositional calculus
resolution in the propositional calculus
Anju Kanjirathingal
 
The propositional calculus
The propositional calculusThe propositional calculus
The propositional calculus
Anju Kanjirathingal
 
microprocessor
microprocessormicroprocessor
microprocessor
Anju Kanjirathingal
 
int 21 h for screen display
int 21 h for screen displayint 21 h for screen display
int 21 h for screen display
Anju Kanjirathingal
 
int 21,16,09 h
int 21,16,09 hint 21,16,09 h
int 21,16,09 h
Anju Kanjirathingal
 
Intel 80286
Intel 80286Intel 80286
Intel 80286
Anju Kanjirathingal
 
OO Design Principles
OO Design PrinciplesOO Design Principles
OO Design Principles
Anju Kanjirathingal
 

More from Anju Kanjirathingal (9)

Java withrealworldtechnology
Java withrealworldtechnologyJava withrealworldtechnology
Java withrealworldtechnology
 
resolution in the propositional calculus
resolution in the propositional calculusresolution in the propositional calculus
resolution in the propositional calculus
 
The propositional calculus
The propositional calculusThe propositional calculus
The propositional calculus
 
microprocessor
microprocessormicroprocessor
microprocessor
 
int 21 h for screen display
int 21 h for screen displayint 21 h for screen display
int 21 h for screen display
 
int 21,16,09 h
int 21,16,09 hint 21,16,09 h
int 21,16,09 h
 
Intel 80286
Intel 80286Intel 80286
Intel 80286
 
OO Design Principles
OO Design PrinciplesOO Design Principles
OO Design Principles
 
2 3 tree
2 3 tree2 3 tree
2 3 tree
 

Recently uploaded

Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
Jisc
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
camakaiclarkmusic
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
heathfieldcps1
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
Jisc
 
Polish students' mobility in the Czech Republic
Polish students' mobility in the Czech RepublicPolish students' mobility in the Czech Republic
Polish students' mobility in the Czech Republic
Anna Sz.
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
Atul Kumar Singh
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
Vikramjit Singh
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
Balvir Singh
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
Levi Shapiro
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
MIRIAMSALINAS13
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
Thiyagu K
 
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCECLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
BhavyaRajput3
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
DeeptiGupta154
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
Pavel ( NSTU)
 
Honest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptxHonest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptx
timhan337
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
JosvitaDsouza2
 
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
Nguyen Thanh Tu Collection
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
Delapenabediema
 
The Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdfThe Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdf
kaushalkr1407
 
Embracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic ImperativeEmbracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic Imperative
Peter Windle
 

Recently uploaded (20)

Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
 
Polish students' mobility in the Czech Republic
Polish students' mobility in the Czech RepublicPolish students' mobility in the Czech Republic
Polish students' mobility in the Czech Republic
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
 
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCECLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
 
Honest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptxHonest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptx
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
 
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
 
The Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdfThe Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdf
 
Embracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic ImperativeEmbracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic Imperative
 

TCP/IP

  • 2. OSI Model TCP/IP Hierarchy Protocols 7th Application Layer 6th Presentation Layer 5th Session Layer 4th Transport Layer 3rd Network Layer 2nd Link Layer 1st Physical Layer Application Layer Transport Layer Network Layer Link Layer OSI v/s TCP/IP
  • 3. Transmission Control Protocol (TCP)  Major transport service in the TCP/IP suite  Used for most Internet applications (esp. World Wide Web) Connection-oriented protocol Provides a reliable unicast end-to-end byte stream over an unreliable internetwork. Very complex • Specifies format of data and acks • Specifies how TCP software distinguishes among multiple destinations on a host • How hosts recover from lost or duplicated packets • How hosts initiate and terminate a transfer TCP IP Internetwork ByteStream ByteStream TCP
  • 4. TCP Characteristics  Stream orientation  Virtual circuit connection  Buffered transfer  Unstructured stream  Full duplex connection  Reliability
  • 5. Providing Reliability Traditional technique: Positive Acknowledgement with Retransmission (PAR) • Receiver sends acknowledgement when data arrives • Sender starts timer whenever transmitting • Sender retransmits if timer expires before • acknowledgement arrives
  • 6. Illustration Of Sliding Window Window size is fixed As acknowledgement arrives, window moves forward  Why Sliding Window Works Because a well-tuned sliding window protocol keeps the network completely saturated with packets, it obtains substantially higher throughput than a simple positive acknowledgement protocol.
  • 8. Conceptual Layering Layering Of The Three Major Protocols Application Reliable Stream (TCP) User Datagram (UDP) Internet (IP) Network Interface
  • 9. Ports, Connections, and Endpoints Like UDP, TCP resides in the transport layer Like UDP, TCP uses protocol port numbers to identify the ultimate destination within a host TCP ports are much more complex than UDP ports TCP port numbers do not correspond to a single object. TCP is built on the connection abstraction, in which objects are identified by connections. A connection is a pair of endpoints. An endpoint is a pair, (host, port). Two connections might share one endpoint.
  • 10. TCP connection between two endpoints identified by four items  Sender’s IP address  Sender’s protocol port number  Receiver’s IP address  Receiver’s protocol port number An Important Idea About Port Numbers • Because TCP identifies a connection by a pair of endpoints, a given TCP port number can be shared by multiple connections on the same machine.
  • 11. Passive And Active Opens Two sides of a connection  One side waits for contact • A server program • Uses TCP’s passive open One side initiates contact • A client program • Uses TCP’s active open
  • 12. Passive and Active Opens(cntd) • An application program on one end performs a passive open by indicating to the OS that it will accept an incoming connection. The OS provides a TCP port number for its end of the connection. • An application program on the other end uses an active open request a connection. • The two TCP software modules communicate to establish and verify a connection. • Once the connection is established, the application programs begin to pass data. • TCP modules at each end guarantee reliable delivery.
  • 13. Segments, Streams, and Sequence Numbers TCP views the data as a sequence of octets that it divides into segments. Usually, each segment travels in a single IP datagram. TCP uses a specialized sliding window mechanism to solve two problems: efficient transmission and flow control. TCP allows the receiver to restrict transmission until it has sufficient buffer space to accommodate more data. The sliding window mechanism operates the octet level. A sender keeps three pointers associated with each connection. TCP software at each end maintains two windows per connection for a total of four.  One slides as data is sent, the other as data is received.
  • 14. Variable Window Size and Flow Control TCP allows the window size to vary over time. Each ack contains a window advertisement that specifies how many octets of data the receiver is prepared to accept. This provides flow control. The window size may even be zero. When intermediate machines become overloaded, the condition is called congestion, and mechanisms to solve the problem are called congestion control mechanisms. Solves two independent problems. • A hand-held PDA communicating with a fast PC may be overrun. •A mechanism is needed to allow intermediate systems (routers) to control a source that sends more traffic than the system can tolerate.
  • 15. TCP Segment Format IP header TCP header TCP data Sequence number (32 bits) DATA 20 bytes 20 bytes 0 15 16 31 Source Port Number Destination Port Number Acknowledgement number (32 bits) window size header length 0 Flags Options (if any) TCP checksum urgent pointer 20bytes
  • 16. Port Number: • A port number identifies the endpoint of a connection. • A pair <IP address, port number> identifies one endpoint of a connection. • Two pairs <client IP address, server port number> and <server IP address, server port number> identify a TCP connection. TCP IP Applications 23 10480Ports: TCP IP Applications 7 1680 Ports:
  • 17. Sequence Number (SeqNo): • Sequence number is 32 bits long. • So the range of SeqNo is 0 <= SeqNo <= 232 -1  4.3 Gbyte • Each sequence number identifies a byte in the byte stream • Initial Sequence Number (ISN) of a connection is set during connection establishment Acknowledgement Number (AckNo): • Acknowledgements are piggybacked, I.e a segment from A -> B can contain an acknowledgement for a data sent in the B -> A direction
  • 18. 18 • A hosts uses the AckNo field to send acknowledgements. (If a host sends an AckNo in a segment it sets the “ACK flag”) • The AckNo contains the next SeqNo that a hosts wants to receive Example: The acknowledgement for a segment with sequence numbers 0-1500 is AckNo=1501 • TCP uses the sliding window flow protocol (see CS 457) to regulate the flow of traffic from sender to receiver • TCP uses the following variation of sliding window: ono NACKs (Negative ACKnowledgement) oonly cumulative ACKs
  • 19. 19 Header Length ( 4bits): • Length of header in 32-bit words • Note that TCP header has variable length (with minimum 20 bytes) Flag bits: • URG: Urgent pointer is valid oIf the bit is set, the following bytes contain an urgent message in the range: oSeqNo <= urgent message <= SeqNo+urgent pointer • ACK: Acknowledgement Number is valid • PSH: PUSH Flag oNotification from sender to the receiver that the receiver should pass all data that it has to the application. oNormally set by sender when the sender’s buffer is empty
  • 20. • RST: Reset the connection oThe flag causes the receiver to reset the connection oReceiver of a RST terminates the connection and indicates higher layer application about the reset • SYN: Synchronize sequence numbers oSent in the first packet when initiating a connection • FIN: Sender is finished with sending oUsed for closing a connection oBoth sides of a connection must send a FIN TCP Checksum: • TCP checksum covers over both TCP header and TCP data (also covers some parts of the IP header)
  • 21. 21 • Window Size: • Each side of the connection advertises the window size • Window size is the maximum number of bytes that a receiver can accept. • Maximum window size is 216-1= 65535 bytes • Urgent Pointer: • Only valid if URG flag is set
  • 22. • Options: End of Options kind=0 1 byte NOP (no operation) kind=1 1 byte Maximum Segment Size kind=2 1 byte len=4 1 byte maximum segment size 2 bytes Window Scale Factor kind=3 1 byte len=3 1 byte shift count 1 byte Timestamp kind=8 1 byte len=10 1 byte timestamp value 4 bytes timestamp echo reply 4 bytes
  • 23. 23 • Options: • NOP is used to pad TCP header to multiples of 4 bytes • Maximum Segment Size • Window Scale Options oIncreases the TCP window from 16 to 32 bits, I.e., the window size is interpreted differently oThis option can only be used in the SYN segment (first segment) during connection establishment time • Timestamp Option oCan be used for roundtrip measurements
  • 24. Connection Setup • The client sends a synchronisation (SYN) packet specifying • The port number of the server • The clients initial sequence number • The server responds with its own SYN segment, which specifies its initial sequence number (ISN). The server also acknowledges the clients SYN. This segment is called a SYN,ACK. • The client must acknowledge the SYN from the server by acking the server’s ISN. • This is called a three way handshake • Host A performs an Active Open • Host B performs a Passive Open • Both sides agree on initial sequence numbers • Both sides advertise initial window sizes • Both sides are now ready to transfer data send SYN seq=x receive SYN segment send SYN seq=y, ACK x+1 receive SYN +ACK segment send ACK y+1 receive ACK segment host A host B
  • 25. Connection Closure • It takes four segments to terminate a connection • Each direction of data flow is closed separately. • It is possible for a TCP connection to be half closed • Finish segments are issued as a result of an application close • ACKs of FIN segments are issued by TCP without reference to the application • Host A performs an active close • Host B performs a passive close • FIN of A is ACKed immediately by TCP • Host B only issues its own FIN when the application has reacted to receipt of the first FIN, by issuing a send FIN seq=x receive FIN segment receive FIN +ACK segment send ACK y+1 receive ACK segment host A host B receive ACK segment send ACK x+1 send FIN seq=y, ACKx+1
  • 26. TCP State Transitions • Each TCP connection keeps a record of its state, which allows the connection to progress through several transitions until closure • The state transitions facilitate connection set up and termination • All data transfer takes place within the Established state.
  • 27. Starting Point Normal transitions for a server Active open recv: FIN recv: ACK send: FIN recv: FIN Normal transitions for a client State SYN_RCVD LISTEN ESTABLISHED SYN_SENT CLOSE_WAIT LAST_ACK FIN_WAIT_1 FIN_WAIT_2 TIME_WAIT Key Active Close Passive Close CLOSED send: ACK appl: passive open Data transfer state 2MSL timeout Name of the TCP state appl: transition undertaken when application issues operation recv: transition undertaken when segment received send: what is sent for this transition Passive Open CLOSING
  • 28. Starting Point Normal transitions for a server Active open recv: FIN send:ACK recv: ACK Normal transitions for a client State SYN_RCVD LISTEN ESTABLISHED SYN_SENT CLOSE_WAIT LAST_ACK FIN_WAIT_1 FIN_WAIT_2 TIME_WAIT Key Active Close Passive Close CLOSED Data transfer state 2MSL timeout Name of the TCP state appl: transition undertaken when application issues operation recv: transition undertaken when segment received send: what is sent for this transition CLOSING
  • 29. Starting Point Normal transitions for a server Active open recv: FIN send:ACK recv: ACK send: FIN recv: FIN recv: ACK Normal transitions for a client State SYN_RCVD LISTEN ESTABLISHED SYN_SENT CLOSE_WAIT LAST_ACK FIN_WAIT_1 FIN_WAIT_2 TIME_WAIT Key Active Close Passive Close CLOSED send: ACK appl: passive open Data transfer state 2MSL timeout Name of the TCP state appl: transition undertaken when application issues operation recv: transition undertaken when segment received send: what is sent for this transition Passive Open CLOSING
  • 30. Starting Point Normal transitions for a server simultaneous open send: SYN,ACK recv: SYN Active open simultaneous close recv: FIN send:ACK recv: FIN send: ACK recv: ACK send: FIN recv: FIN send: FIN recv: ACK recv: ACK Normal transitions for a client State SYN_RCVD LISTEN ESTABLISHED SYN_SENT CLOSE_WAIT LAST_ACK CLOSINGFIN_WAIT_1 FIN_WAIT_2 TIME_WAIT Key Active Close Passive Close TCP State Transitions CLOSED send: ACK appl: passive open appl: close Data transfer state 2MSL timeout appl: close or timeout Name of the TCP state appl: transition undertaken when application issues operation recv: transition undertaken when segment received send: what is sent for this transition Passive Open