TCP/IP Application Model
Download
1 / 18

del - PowerPoint PPT Presentation


  • 187 Views
  • Updated On :

TCP/IP Application Model. Application. TCP. UDP. IP. Network Protocols. Protocol Stack. UDP Connectionless Transport Protocol. UDP extends the host-host delivery service of the underlying network into a process-process communication service.

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'del' - Anita


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
Slide1 l.jpg

TCP/IP Application Model

Application

TCP

UDP

IP

Network Protocols

Protocol Stack


Slide2 l.jpg

UDP Connectionless Transport Protocol

UDP extends the host-host delivery service of the underlying network into a process-process communication service.

  • Provides a multiplexing/demultiplexing service to allow multiple processes on each host to share the network.

  • Ensures correctness of the message by use of a checksum.

  • Adds no other functionality beyond “best effort” delivery service of the underlying network.


Slide3 l.jpg

0

16

31

UDP Header Format

Destination Port

Source Port

Checksum

Length

Data


Slide4 l.jpg

Determining the UDP Checksum

PseudoHeader

UDP Length

Protocol

Pad = 00000000

Source IP Address

Destination IP Address

Source Port

Destination Port

Length

Checksum

Data

UDP Datagram


Slide5 l.jpg

Application

process

Application

process

Application

process

UDP

Ports

Queues

Packets demultiplexed

Packets arrive


Slide6 l.jpg

TCP a Reliable Byte Stream Protocol

TCP (Transport Control Protocol) is a connection oriented protocol that guarantees the reliable, in-order delivery of a stream of bytes.

  • TCP is full-duplex (it supports a pair of byte streams flowing in opposite directions.)

  • It provides for flow control which allows a receiver to limit the rate at which a sender can transmit.

  • It implements a congestion control mechanism which throttles the sender from overloading the network.

  • Like UDP, it provides for multiplexing/demultiplexing of packets


Slide7 l.jpg

TCP Packet Format

For reliable, in order delivery

For flow control

For process demultiplexing

Other fields

Destination Port

Source Port

Sequence Number (byte count)

Acknowledgement

0

Flags

Advertised Window

HdrLen

Checksum

Urgent Pointer

Options (variable length)

Data


Slide8 l.jpg

SrcPort=21

DstPort=13

ScrPort=13

DstPort=21

ScrPort=13

DestPort=21

SEQ = 1234

SEQ = 6789

SEQ = 1235

ACK = xxxx

ACK = 1235

ACK = 6790

5

5

0

0

SYN

ACK

1024

1024

5

0

SA

2048

Checksum

NIL

Checksum

NIL

Checksum

NIL

Receiver sends acceptance

Initiator prepares ACK

Initiator sends ACK

The Three-way Handshake

Initiator

Receiver

ScrPort=13

DstPort=21

ScrPort=21

DstPort=13

ScrPort=13

DestPort=21

SEQ = 1235

SEQ = 1234

SEQ = 6789

ACK = 6790

ACK = xxxx

ACK = 1235

5

5

0

0

SYN

ACK

1024

1024

5

0

SA

2048

Checksum

NIL

NIL

Checksum

Checksum

NIL

Receiver prepares acceptance

Initiator sends request to Receiver


Slide9 l.jpg

Demonstration of TCP Byte Transfer

TCP Demonstration

This applet demonstrates an initial 3-way handshake to establish a TCP connection, then illustrates the use of the advertised window to regulate the exchange of bytes between the two hosts.

Current limitations: Buttons are not installed, the processing time is taken to be about 25 seconds for easier viewing.


Slide10 l.jpg

Host B’s State

CLOSED

active open/SYN

passive open

close

LISTEN

LISTEN

LISTEN

SYN / SYN+ACK

Send/SYN

SYN_RCVD

SYN_SENT

SYN / SYN+ACK

ACK

Close / FIN

SYN+ACK / ACK

ESTABLISHED

FIN / ACK

Close / FIN

CLOSE_WAIT

FIN_WAIT_1

FIN / ACK

Close / FIN

ACK

LAST_ACK

CLOSING

FIN_WAIT_2

ACK

ACK

ACK+FIN / ACK

TIME_WAIT

CLOSED

FIN / ACK

Host A’s State

A Sends SYN

TCP Connection

Closed

Connected

A Initiates Close

LISTEN

SYN_RCVD

SYN_RCVD

SYN_SENT

SYN_SENT

ESTABLISHED

ESTABLISHED

CLOSE_WAIT

CLOSE_WAIT

FIN_WAIT_1

FIN_WAIT_1

LAST_ACK

LAST_ACK

FIN_WAIT_2

FIN_WAIT_2

TIME_WAIT

TIME_WAIT

CLOSED

CLOSED


Slide11 l.jpg

Port: An abstraction for locating services

Each service is associated with a given port number on a given machine. When you ask for a particular port, you are requesting the service associated with that port number.

There are 2 ** 16 available numbers, but the numbers 1 – 1024 are reserved for “well-known” services and should not be used for user initiated services.

Port number 7 is used for the echo server and

Port number 13 is used for the time and date service

It is up to the client to know which port number the desired service is running on.


Slide12 l.jpg

Flow Control

  • Data is sent over a TCP (virtual) connection as a byte stream

  • An ACK contains the number of the last byte received and an Advertised Window specifying the number of additional bytes that can be sent.

  • A sender will set a timer after each TCP packet is sent, and if an ACK is not returned before the timer times out, it will resend that packet.

  • Problem – on an Internet where the distance to the receiver and the route to this destination are not known a priori, to what value should the timer be set?


Slide13 l.jpg

Flow Control

  • Determining Timeout value

  • The timeout value must be determined by sampling the the RTT (round trip time) periodically

  • The Jacobson-Karels algorithm

  • Let Estimated RTT be the running average of the measurements

Don’t count retransmissions in the sample RTT

Diff = SampleRTT - EstimatedRTT

EstimatedRTT = EstimatedRTT + δ* Diff

where 0 < δ < 1

Deviation = Deviation + δ * (Diff - Deviation)

TimeOut = μ* EstimatedRTT + φ * Deviation

where by experience μ = 1 and φ = 4


Slide14 l.jpg

Previous AW = 4096 Bytes

Last byte sent = 3072

Previous ACK =1025

Byte # 3608

New AW = 1560 Bytes

Last ACK = 2049

Use of the AW in Flow Control

ACK # + AW size means sender can send AW-size bytes starting with last byte ACKed

Additional bytes permitted = 536

Start: (1) Sender has permission to send 4096 bytes starting with byte # 1025

(2) Sender sends 2 packets of 1024 bytes each

(3) ACK of first packet is returned with AW = 1560 bytes (reduced from previous)

(4) Sender can transmit an additional 536 bytes before having to receive new ACK


Slide15 l.jpg

Congestion Control

Flow Control is the restriction placed upon data rate of the sender by the receiver. It is accomplished by using the ACK and AW (advertised window)

Congestion Control is implemented by routers along the path that are experiencing congestion. They simply drop an IP packet when they exceed a certain buffer threshold. When a sender does not receive an ACK, or receives duplicate ACKs (indicating that a packet did not get through), it has to reduce its Congestion Window size. The effective window size is the min(AW, Congestion Window size).

The Congestion Window is regulated by a sender based upon the feedback it receives from its previous transmissions.


Slide16 l.jpg

Congestion Control

The sender “experimentally” tries to determine the maximum achievable throughput on the network. Example below illustrates slow start with multiplicative decrease and additive increase. (Each packet is MSS bytes)

packets


Slide17 l.jpg

Congestion Control

There are a number of techniques that can be used to “smooth out” this sawtooth pattern a bit. Some of these variations are named after cities in Nevada.

TCP-Vegas: The sender periodically measures the RTT and calculates the number of bytes sent between the sending of the first segment and the receipt of the ACK. This information is used to determine a maximum and an effective Congestion Window size and the CW is raised or lowered accordingly. TCP-Vegas tries to minimize the number of times that the CW must be abruptly lowered.


Slide18 l.jpg

The Future?

TCP was designed in an era where performance was limited by bandwidth (throughput)

With the availability Gb/s and greater data rates, network performance is limited by latency. How does TCP adapt to these new circumstances?


ad