Computer Networks [PDF]

Port represents a particular transport service (TS) user. • Transport entity identification. ◇ Generally only one pe

24 downloads 5 Views 859KB Size

Recommend Stories


PDF Computer Networks, Fifth Edition
The only limits you see are the ones you impose on yourself. Dr. Wayne Dyer

PDF Computer Networks (5th Edition)
What you seek is seeking you. Rumi

Computer Networks
Before you speak, let your words pass through three gates: Is it true? Is it necessary? Is it kind?

[PDF] Download Computer Networks and Internets
I tried to make sense of the Four Books, until love arrived, and it all became a single syllable. Yunus

PDF Download Data Communications and Computer Networks
There are only two mistakes one can make along the road to truth; not going all the way, and not starting.

CSE 123 Computer Networks
We must be willing to let go of the life we have planned, so as to have the life that is waiting for

A survey Computer Networks
The greatest of richness is the richness of the soul. Prophet Muhammad (Peace be upon him)

ELEC3030 Computer Networks
We can't help everyone, but everyone can help someone. Ronald Reagan

Chapter 7 Computer Networks
Don't fear change. The surprise is the only way to new discoveries. Be playful! Gordana Biernat

IT307 Computer Networks
And you? When will you begin that long journey into yourself? Rumi

Idea Transcript


Computer Networks Chapter 5 Transport Protocols

Transport Protocol ƒ Provides end-to-end transport • Hides the network details

ƒ Transport protocol or service (TS) offers: • • • • • • •

Different types of services QoS Data transfer User interface Connection management Status reporting Security

ƒ e.g. TCP

Reliable Sequencing Network Service ƒ Assume arbitrary length message ƒ Assume virtually 100% reliable delivery by network service • e.g. reliable packet switched network using X.25 • e.g. frame relay using LAPF control protocol • e.g. IEEE 802.3 using connection oriented LLC service

ƒ Transport service is end to end protocol between two systems on same network

Issues in a Simple Transport Protocol ƒ ƒ ƒ ƒ

Addressing Multiplexing Flow Control Connection establishment and termination

Addressing ƒ Target user specified by: • User identification Š Usually host, port ▫ Called a socket in TCP

Š Port represents a particular transport service (TS) user

• Transport entity identification Š Generally only one per host Š If more than one, then usually one of each type ▫ Specify transport protocol (TCP, UDP)

• Host address Š An attached network device Š In an internet, a global internet address

• Network number

Finding Addresses ƒ Four methods • Know address ahead of time Š e.g. collection of network device stats

• Well known addresses (DNS root-names) • Name server

Multiplexing ƒ Multiple users employ same transport protocol ƒ User identified by port number or service access point (SAP) ƒ May also multiplex with respect to network services used • e.g. multiplexing a single virtual X.25 circuit to a number of transport service user Š X.25 charges per virtual circuit connection time

Flow Control ƒ Problems • Longer transmission delay between transport entities compared with actual transmission time Š Delay in communication of flow control info

• Variable transmission delay Š Difficult to use timeouts

ƒ Flow may be controlled because: • The receiving user can not keep up • The receiving transport entity can not keep up

ƒ Results in buffer filling up

Flow Control

Coping with Flow Control Requirements (1) ƒ Do nothing • Segments that overflow are discarded • Sending transport entity will fail to get ACK and will retransmit Š Thus further adding to incoming data

ƒ Refuse further segments • Coarse grained • Multiplexed connections are canceled if one channel is refused

Coping with Flow Control Requirements (2) ƒ Use fixed sliding window protocol • Works well on reliable network Š Failure to receive ACK is taken as flow control indication

• Does not work well on unreliable network Š Can not distinguish between lost segment and flow control

ƒ Use credit scheme

Credit Scheme ƒ Greater control on reliable network ƒ More effective on unreliable network ƒ Decouples flow control from ACK • May ACK without granting credit and vice versa

ƒ Each octet has sequence number ƒ Each transport segment has seq number, ack number and window size in header

Credit Allocation

Sending and Receiving Perspectives

Establishment and Termination ƒ ƒ ƒ ƒ

Allow each end to know the other exists Negotiation of optional parameters Triggers allocation of transport entity resources By mutual agreement

Connection State Diagram

Connection Establishment

Not Listening ƒ Reject with RST (Reset) ƒ Queue request until matching open issued ƒ Signal TS user to notify of pending request • May replace passive open with accept

Termination ƒ ƒ ƒ ƒ

Either or both sides By mutual agreement Abrupt termination Or graceful termination • Close wait state must accept incoming data until FIN received

Side Initiating Termination ƒ TS user Close request ƒ Transport entity sends FIN, requesting termination ƒ Connection placed in FIN WAIT state • Continue to accept data and deliver data to user • Not send any more data

ƒ When FIN received, inform user and close connection

Side Not Initiating Termination ƒ FIN received ƒ Inform TS user Place connection in CLOSE WAIT state • Continue to accept data from TS user and transmit it

ƒ TS user issues CLOSE primitive ƒ Transport entity sends FIN ƒ Connection closed ƒ All outstanding data is transmitted from both sides ƒ Both sides agree to terminate

Unreliable Network Service ƒ E.g. • internet using IP, • frame relay using LAPF • IEEE 802.3 using unacknowledged connectionless LLC

ƒ Segments may get lost ƒ Segments may arrive out of order

Problems ƒ ƒ ƒ ƒ ƒ ƒ ƒ

Ordered Delivery Retransmission strategy Duplication detection Flow control Connection establishment Connection termination Crash recovery

Ordered Delivery ƒ ƒ ƒ ƒ

Segments may arrive out of order Number segments sequentially TCP numbers each octet sequentially Segments are numbered by the first octet number in the segment

Retransmission Strategy ƒ Scenarios that need retransmit • Segment damaged in transit • Segment fails to arrive

ƒ ƒ ƒ ƒ

Transmitter does not know of failure Receiver must acknowledge successful receipt Use cumulative acknowledgement Time out waiting for ACK triggers re-transmission

Timer Value ƒ Fixed timer • • • • •

Based on understanding of network behavior Can not adapt to changing network conditions Too small leads to unnecessary re-transmissions Too large and response to lost segments is slow Should be a bit longer than round trip time

ƒ Adaptive scheme • May not ACK immediately • Can not distinguish between ACK of original segment and re-transmitted segment • Conditions may change suddenly

Duplication Detection ƒ If ACK lost, segment is re-transmitted ƒ Receiver must recognize duplicates ƒ Duplicate received prior to closing connection • Receiver assumes ACK lost and ACKs duplicate • Sender must not get confused with multiple ACKs • Sequence number space large enough to not cycle within maximum life of segment

ƒ Duplicate received after closing connection

Incorrect Duplicate Detection

Flow Control ƒ Credit allocation (ACK=N, CREDIT=M) acknowledge all segments through N-1 and allows segment from N through M+N-1 to be transmitted ƒ Problem if ACK=i, CREDIT=0 closing window ƒ Send ACK=i, CREDIT=j to reopen, but this is lost ƒ Sender thinks window is closed, receiver thinks it is open ƒ Use window timer ƒ If timer expires, send something • Could be re-transmission of previous segment

Connection Establishment ƒ Two way handshake • A send SYN, B replies with SYN • Lost SYN handled by re-transmission Š Can lead to duplicate SYNs

• Ignore duplicate SYNs once connected

ƒ Lost or delayed data segments can cause connection problems • Segment from old connections • Start segment numbers far from previous connection Š Use SYN i Š Need ACK to include i Š Three Way Handshake

Two Way Handshake: Obsolete Data Segment

Two Way Handshake: Obsolete SYN Segment

Three Way Handshake: State Diagram

Three Way Handshake: Examples

Connection Termination ƒ Entity in CLOSE WAIT state sends last data segment, followed by FIN ƒ FIN arrives before last data segment ƒ Receiver accepts FIN • Closes connection • Loses last data segment

ƒ Associate sequence number with FIN ƒ Receiver waits for all segments before FIN sequence number ƒ Loss of segments and obsolete segments • Must explicitly ACK FIN

Graceful Close ƒ Send FIN i and receive ACK i ƒ Receive FIN j and send ACK j ƒ Wait twice maximum expected segment lifetime

Crash Recovery ƒ After restart all state info is lost ƒ Connection is half open • Side that did not crash still thinks it is connected

ƒ Close connection using persistence timer • Wait for ACK for (time out) * (number of retries) • When expired, close connection and inform user

ƒ Send RST i in response to any i segment arriving ƒ User must decide whether to reconnect • Problems with lost or duplicate data

TCP & UDP ƒ Transmission Control Protocol • Connection oriented • RFC 793

ƒ User Datagram Protocol (UDP) • Connectionless • RFC 768

TCP Services ƒ Reliable communication between pairs of processes ƒ Across variety of reliable and unreliable networks and internets ƒ Two labeling facilities • Data stream push Š TCP user can require transmission of all data up to push flag Š Receiver will deliver in same manner Š Avoids waiting for full buffers

• Urgent data signal Š Indicates urgent data is upcoming in stream Š User decides how to handle it

TCP Header

Items Passed to IP ƒ TCP passes some parameters down to IP • • • • •

Precedence Normal delay/low delay Normal throughput/high throughput Normal reliability/high reliability Security

TCP Mechanisms (1) ƒ Connection establishment • Three way handshake • Between pairs of ports • One port can connect to multiple destinations

TCP Mechanisms (2) ƒ Data transfer • • • •

Logical stream of octets Octets numbered modulo 232 Flow control by credit allocation of number of octets Data buffered at transmitter and receiver

TCP Mechanisms (3) ƒ Connection termination • • • •

Graceful close TCP users issues CLOSE primitive Transport entity sets FIN flag on last segment sent Abrupt termination by ABORT primitive Š Entity abandons all attempts to send or receive data Š RST segment transmitted

Implementation Policy Options ƒ ƒ ƒ ƒ ƒ

Send Deliver Accept Retransmit Acknowledge

Send ƒ If no push or close TCP entity transmits at its own convenience ƒ Data buffered at transmit buffer ƒ May construct segment per data batch ƒ May wait for certain amount of data

Deliver ƒ In absence of push, deliver data at own convenience ƒ May deliver as each in order segment received ƒ May buffer data from more than one segment

Accept ƒ Segments may arrive out of order ƒ In order • Only accept segments in order • Discard out of order segments

ƒ In windows • Accept all segments within receive window

Retransmit ƒ TCP maintains queue of segments transmitted but not acknowledged ƒ TCP will retransmit if not ACKed in given time • First only • Batch • Individual

Acknowledgement ƒ Immediate ƒ Cumulative

UDP ƒ User datagram protocol ƒ RFC 768 ƒ Connectionless service for application level procedures • Unreliable • Delivery and duplication control not guaranteed

ƒ Reduced overhead ƒ e.g. network management

UDP Applications ƒ Client-server application • Request-Response • e.g. DNS

ƒ Real time application

UDP Header

Smile Life

When life gives you a hundred reasons to cry, show life that you have a thousand reasons to smile

Get in touch

© Copyright 2015 - 2024 PDFFOX.COM - All rights reserved.