Layer 4 - Transport Layer

Size: px
Start display at page:

Download "Layer 4 - Transport Layer"

Transcription

1 Layer 4 - Transport Layer Core of the protocol hierarchy: Network-independent, reliable and economical data transfer Tasks of the transport layer: Connection-oriented or connectionless data transfer Addressing of a certain communication process on a computer Error detection, error correction Flow control Multiplexing 1. Upward - several transport connections to one network connection 2. Downward - one transport connection to several network connections (e.g. if not sufficient capacity of a network connection is given) Weak quality guarantees: reliability Page 1

2 What do we need a Transport Layer for? Similarity to layer 3: Connection-oriented and connectionless data transmission (The Internet layer in connectionless, but in general layer 3 also could be connectionoriented) Addressing Flow control Is layer 4 redundant? No, because: The network layer belongs to the network carrier: A user does not have any control over network details and problems Hiding of technical details from higher layers Addressing of a destination process End-to-end view of a data flow Generally: Improvement of the quality of the data communication on layer 3 Page 2

3 Transport Protocols in the TCP/IP Reference Model Connection-oriented Connectionless HTTP FTP Telnet SMTP DNS SNMP TFTP Application Layer TCP UDP Transport Layer IGMP ICMP IP ARP RARP Internet Layer Ethernet Token Ring Token Bus Wireless LAN Host-to-Network Layer TCP (Transmission Control Protocol): Reliable, connection-oriented. UDP (User Datagram Protocol): Datagram principle, connectionless, unreliable, without flow control, permutation of a packet order can happen. Page 3

4 The Transport Layer TCP and UDP A Client process IP network Transport protocols are used by the application layer as communication services. They make communication available between application processes. UDP is a connectionless and fast protocol TCP is a connection-oriented and reliable protocol virtual connections only, using the connectionless IP for transmitting data B Server process Page 4

5 Characteristics of TCP Connection-oriented and reliable (error-free, keeps packet order, without duplicates) Error handling, acknowledgments, flow control (Sliding Window procedure) Byte stream, not message stream Segmentation (max. segment size of 64 KByte) Urgent -messages outside of flow control Limited QoS Addressing of the application by port numbers Port number Client Application layer Server 1 Server 2 IP address Transport layer Network layer Host-to-network layer Server waits on several ports Page 5

6 Port Numbers for TCP-based Applications File transfer Virtual terminal World Wide Web Routing information FTP telnet Electronic Mail SMTP HTTP BGP / Well known TCP ports RFC 1700 Port number is 16-bit address Ports from 0 to 1023 are reserved for standardized applications Ports from 1024 to can be specified by each host Page 6

7 TCP as a Safe Connection Establishes logical connections between two Sockets: IP address + 16 bit port number (48 bit address information) For an application, sockets are the access point to the network A socket can be used for several connections at the same time TCP connections are always full-duplex and point-to-point connections TPDUs exchanged between the two communicating stations are called segments Segments are being exchanged for realizing Connection establishment, Data transmission, Sending of confirmations, Connection termination. For simplicity: only one header format defined for all segments the task of a segment is marked by special flags Page 7

8 Connection-orientation of TCP Connection-oriented classically means use a determined connection (path) to send all data packets But: TCP sits on top of the connectionless IP and has no influence on the chosen path Thus: TCP in principal transfers the data connectionless, but adds control information in its header for appearing connection-oriented to higher-layer protocols Simple idea: Like on layer 2, number all segments before transmission On receiver side, check the stream of segments on completeness and correct order Re-transmit missing segments Page 8

9 The TCP Header Bit position Source Port Destination Port 20 byte default header Sequence Number Plus options Acknowledgement Number Up to data bytes HL Res. 6 Flags Window Size Checksum Options Urgent Pointer Padding Data Page 9

10 The TCP Header Source and Destination Port: port number of sender resp. receiver Sequence Number/Acknowledgment Number: Segments have a 32 bit sequence and acknowledgement number for the window mechanism in flow control (Sliding Window). Sequence and acknowledgement number count single bytes! The acknowledgement number indicates the next expected byte! Sequence numbers begin not necessarily with 0! A random value is chosen here to avoid a possible mix-up of segments for a new connection with old segments from the last connection which could maybe arrive late. Piggybacking, i.e. an acknowledgement can be sent in a data segment. HL: As in case of IP, also the TCP header has an indication of its length. The length is counted in 32-bit words. Res = Reserved for later use. Window Size: Size of the receiver s buffer for the connection. Used in flow control: the window of a flow indicates, how many bytes at the same time can be sent the size of the buffer indicates, how many bytes can be stored within the receiver. The window of flow control is adapted to this value. Page 10

11 The TCP Header Flags: URG (URGENT): When this flag is set the field urgent pointer becomes valid, to submit important data immediately even if flow control would not allow for. ACK: This bit is set, if an acknowledgement is sent. PSH (PUSH): Immediate forwarding of the data, no more waiting for further data (i.e. immediate transmission on sender side, immediate processing on receiver side without long buffering). RST (RESET): Reset a connection, e.g. during a host crash or a connecting rejection. The connection immediately is termindated. SYN (Synchronize): set to 1 for the establishment of a connection. FIN (Final): set to 1 for the termination of a connection. Urgent pointer: indicates, at which position in the data field the urgent data end (byte offset of the current sequence number). Option: additional functions: negotiation of a window scale; use of e.g. Selective Repeat instead of Go-Back-n in the event of an error; Indication of the Maximum Segment Size (MSS) to determine the size of the data field. Page 11

12 TCP Pseudo Header Checksum: serves among other things for the verification that the packet was delivered to the correct device. The checksum is computed using a pseudo header. The pseudo header is placed in front of the TCP header, the checksum is computed from both headers (the checksum field is occupied here with 0). The checksum is computed as the 1- complement of the sum of all 16-bit words of the segment including the pseudo header. The receiver also places the pseudo header in front of the received TCP header and executes the same algorithm (the result must be 0). Source address (IP) Destination address (IP) Protocol = 6 Length of the TCP segment Now: how are connection establishment, reliable data transmission, and connection termination implemented in TCP? Page 12

13 Connection Establishment Sounds easy is however nevertheless quite complicated: the network can lose packets, store packets, duplicate packets. Solution: Duplicate Sequence numbers Three-Way Handshake A connection establishment consists of three parts: The Connection Request (CR), The confirmation of the receiver that the connection establishment is accepted, Host 1 Host 2 The confirmation of the sender that the confirmation of the receiver was received and the sending request is still given. A compromise between reliability and complexity is to be obtained by this principle. Two variants of this procedure are implemented in TCP CR (seq=x) ACK (seq=y, ACK=x) ACK (seq=x+1, ACK=y) CR (seq=x) ACK (seq=y, ACK=x) REJECT (ACK=y) Host 1 Host 2 Page 13

14 1. Regular TCP Connection Establishment Client SYN, SEQ-No=x SYN, ACK, SEQ-No=y, ACK-No=x+1 ACK, ACK-No=y+1, SEQ-No=x+1 ACK-No = acknowledgement number SEQ-No = sequence number The ACK-No value only is valid if the ACK flag is set to 1! Server The server has to run and wait for connection requests on a certain port. The client connects by with a segment indicating the destination port, initial sequence number (x), and having set the SYN flag to 1 (to indicate that a new connection is to be established). The connection is accepted on server side if the destination port is identical to the one the server waits on, and if the server has enough resources (buffer space) for a new connection. Otherwise it is rejected (set RST flag). The server sends back a segment with set SYN flag to the client, and acknowledges at the same time the receipt of the client s SYN segment (with ACK-No=x+1). Also, an own initial number is passed to the client (y). The client sends an acknowledgement for the SYN segment of the server (ACK-No=y+1). The connection is established. Page 14

15 2. Irregular TCP Connection Establishment Client/Server Client/Server SYN, SEQ-No=x SYN, SEQ-No=y SYN, ACK, SEQ-No=x, ACK-No=y+1 SYN, ACK, SEQ-No=y, ACK-No=x+1 Maybe, two computers at the same time try to establish a connection to each other Connections are characterized by their endpoints; only one connection is established between a pair of endpoints. The endpoints are uniquely characterized: (IP Address 1, Port 1, IP Address 2, Port 2 ) Page 15

16 Data Transmission After connection establishment, all data is transferred in segments: Client Server SEQ=101, ACK=201, DATA 10 Byte SEQ=201, ACK=111 SEQ=111, ACK=201, DATA 50 Byte SEQ=201, ACK=161 Full-duplex connection Segmentation of a byte stream into segments. Usual sizes are 1500, 536 or 512 byte; thus IP fragmentation is avoided. Usual acknowledgement mechanism: all segments up to ACK-1 are confirmed. If the sender has a timeout before an ACK, he repeats the segment. To be more efficient: sliding window mechanism Usual procedure for repeating: Go- Back-N or Selective Repeat. Page 16

17 Flow Control Sliding Window To provide reliable data transfer, as on layer 2 a sliding window mechanism is used. Differences: The window size counts transmitted bytes (instead as frames as on layer 2) Window is shifted by n byte as soon as an ACK for n byte arrives Exception: Urgent data (URGENT flag is set) is sent immediately Characteristic: the window size can be changed during the transmission phase! Why? Segments have to be buffered to allow a sorting of out-of-order segments Segments are buffered till the receiving application process is able to process them Initial window bytes acknowledged Window slides Variable number of connections can exists, all sharing the same buffer Page 17

18 Dynamic Buffer Assignment ack/seq {0,, 15} 1 2 A Message <request 8 buffers> <ack = 15, buf = 4> B A asks for 8 places in B s buffer (8 bytes) B grants 4 buffer places for A and waits for segment 0 3 <seq = 0, data = byte1> A sends segment 0 (only 1 byte per segment, for simplicity) 4 <seq = 1, data = byte2> A sends segment 1 5 <seq = 2, data = byte3> A sends segment 2, segment is lost 6 <ack = 1, buf = 3> B ack s segments 0 and 1, buffer places are reduced to 3 7 <seq = 3, data = byte4> A sends segment 3 Timeout for segment 2 } 8 9 <seq = 4, data = byte5> <seq = 2, data = byte3> A sends segment 4 A repeats segment 2 10 <ack = 4, buf = 0> B acknowledges segments 2-4 sender is stopped (no buffer) 11 <ack = 4, buf = 1> B informs A about 1 buffer place 12 <ack = 4, buf = 2> B informs A about 2 buffer places 13 <seq = 5, data = byte6> A sends segment 5 14 <seq = 6, data = byte7> A sends segment 6; A is blocked (no more buffer) 15 <ack = 6, buf = 0> B acknowledges segments 5+6, but sender remains blocked 16 <ack = 6, buf = 4> B informs A about 4 buffer places A waits for buffer space Chapter B waits 3.5: that A TCP sends and data UDP Danger of deadlock; send control segments in regular time intervals Page 18

19 Dynamic Sliding Window - Example Application writes 2 KB Sender 2K SEQ = 0 Receiver Receiver buffer 0 4K Empty 2K ACK=2048 WIN=2048 Application writes 2 KB 2K SEQ = 2048 Full Sender is blocked Sender can transfer up to 2 KB ACK=4096 WIN=0 ACK=4096 WIN=2048 1K SEQ = 4096 Application reads 2 KB 2K 1K 2K Page 19

20 Silly Window Syndrome Receiver buffer is full Application reads 1 byte Space for 1 byte Header Header Transfer segment for window actualization New byte arrives Receiver buffer is full 1 byte Solution of Clark: The receiver must wait with the next window actualization until the receiver buffer again is reasonably empty Page 20

21 TCP Connection Termination Client Server Termination as two simplex connections FIN, SEQ-No=x, ACK-No=y ACK, SEQ-No=y, ACK-No=x+1 FIN, SEQ-No=y, ACK-No=x+1 Send a segment with set FIN flag If the FIN-segment is confirmed, the corresponding direction is switched off. The opposite direction remains however still opened, data can still be sent. The same procedure as above is to be repeated Use of timers to protect against data loss ACK, SEQ-No=x+1, ACK-No=y+1 Page 21

22 Connection Termination Timers To protect against data loss, timers are used otherwise, if one machine crashes during termination, the other one would wait forever before releasing reserved resources send FIN and start timer terminate connection send confirmation FIN FIN, ACK ACK send FIN and start timer terminate connection Host 1 Host 2 send FIN and start timer Timeout send FIN and start timer terminate connection send confirmation FIN FIN FIN, ACK ACK FIN, ACK send FIN and start timer send FIN and start timer terminate connection send FIN and start timer terminate connection send confirmation FIN FIN, ACK ACK send FIN and start timer Timeout terminate connection Host 1 Host 2 send FIN and start timer Timeout send FIN and start timer : : N Timeouts terminate connection FIN FIN FIN FIN FIN, ACK send FIN and start timer Timeout terminate connection Page 22

23 The Entire TCP Connection Normal path of server Normal path of client Unusual events Event/action pair Event: System call by user, arrival of segment, timeout Action: Send a control segment Page 23

24 States during a TCP Session State CLOSED LISTEN SYN RCVD SYN SENT ESTABLISHED FIN WAIT 1 FIN WAIT 2 TIME WAIT CLOSING CLOSE WAIT LAST ACK No active communications The server waits for a connection request A connection request was received and processed, wait for the last ACK of the connection establishment Application began to open a connection Connection established, transmit data Application starts a connection termination The other side confirms the connection termination Wait for late packets Connection termination The other side initiates a connection termination Wait for late packets Description Page 24

25 Used Timers Persistence timer Lehrstuhl für Informatik 4 Prevents a deadlock with a loss of the buffer release message of a receiver With expiration of the timer, the sender transfers a test segment. The response to this transmission contains the current buffer size of the receiver. If it is still zero, the timer is started again. Keep-alive timer If a connection is inactive for a longer time, at expiration of the timer it is examined whether the other side is still living If no response is given, the connection is terminated Disputed function Time Wait timer During the termination of a connection, the timer runs for the double packet life time to be sure that no more late packets arrive Page 25

26 The Entire TCP Connection Example Client Server Page 26 SYN/SEQ=2999/ACK=x/Window=2500/MSS=1460 ACK/SEQ=3000/ACK=2001/Window=2500 SYN, ACK/SEQ=2000/ACK=3000/Window=4200/MSS=1400 DATA 1400 byte/seq=3000/ack=2001/window=2500 DATA 1400 byte/seq=4400/ack=2001/window=2500 DATA 1400 byte/seq=5800/ack=2001/window=2500 ACK/SEQ=2001/ACK=4400/Window=4200 ACK/SEQ=2001/ACK=5800/Window=4200 ACK/SEQ=2001/ACK=7000/Window=4200 DATA 1400 byte/seq=7000/ack=2001/window=2500 DATA 1400 byte/seq=8400/ack=2001/window=2500 ACK/SEQ=2001/ACK=8400/Window=4200 ACK/SEQ=2001/ACK=9800/Window=4200 FIN, ACK/SEQ=9800/ACK=2001 FIN, ACK/SEQ=2001/ACK=9801 ACK/SEQ=9801/ACK=2002

27 Flow Control - Network Bottlenecks Next problem: when sending as much data as the receiver allows, the network can get overloaded Necessary: Congestion Control (by using a second transmission window) Assumption: packet loss is rarely because of transmission errors, rather because of overload situations Capacity of the receiver: Flow Control Window (Buffer) Capacity of the network: Congestion Window Page 27

28 Control Algorithm in the Internet Each sender maintains two windows for the number of bytes which can be sent: 1. Flow Control Window: granted receiver buffer 2. Congestion Window: network granted capacity (cwnd) Minimum of both windows is the number of bytes which can be sent maximally With connection establishment, the sender initializes the congestion window to the size of the maximum segment (MSS, the MTU the sender is able to send) Maximum segment is sent If an acknowledgement arrives before timeout, double the congestion window (Slow Start Algorithm), otherwise reset it to the initial value. Thus a grope takes place up to the transmission capacity. Enlargement stops with reaching the flow control window Refinement by introduction of a threshold value ssthresh (at the beginning 64 Kbyte): - Only linear enlargement by one maximum segment size (Congestion Avoidance) - With a timeout the threshold value is put back to half of the maximum window size reached before Page 28

29 Control Algorithm in the Internet Congestion Avoidance, groping to the maximum capacity Overload assumed, reduce the data amount Be more careful in the next attempt Slow start, fast utilization of the free capacity Start with one segment Page 29

30 Fast Retransmit and Fast Recovery Slow Start is not well suited when only a single packet is lost Fast Retransmit The receiver should send a duplicate ACK immediately when an out-of-order segment arrives When the sender has received 3 duplicate ACKs, it performs a retransmission of the segment which seems to be missing. Hopefully, the acknowledgement for the repeated segment arrives before a timeout for this segment occurs. Fast Retransmit has to be enhanced to be useful in overload situations Fast Recovery When the third ACK is received, reduce ssthresh to max(current size/2, 2*MSS) Retransmit the missing segment, set cwnd to ssthresh + 3*MSS For each more duplicated ACK, increment cwnd by MSS This reduces cwnd by the amount of lost segments to adapt to the network situation If the new cwnd (and the receiver s buffer) allows, send a segment When the next (normal) ACK arrives, set cwnd to ssthresh to go on normally Page 30

31 Timer Management with TCP TCP uses several timers: Retransmission timer (for repeating a transmission) But: how to select the timer value? Probability density of the time till an acknowledgement arrives: 0.3 T 0.3 T 1 T 2 Wahrscheinlichkeit Probability Wahrscheinlichkeit Probability Problem on the transport layer: T 1 is too small: too many retransmissions Roundtrip-Time Trip [ms] Data Link Layer Round Roundtrip-Time Trip Time [ms] [ms] Transport Layer T 2 is too large: inefficient for actual packet loss Page 31

32 Retransmission Timer Only meaningful solution: dynamic algorithm, which can adapt the timer by current measurements of the network performance. Algorithm of Jacobson (1988): TCP manages a variable RTT (Round Trip Time) for each connection RTT is the momentarily best estimation of the round trip time to the target computer and back When sending a segment, a timer started which measures, which time the acknowledgement needs and initiates a retransmission if necessary. If the acknowledgement arrives before expiration of the timer (after a time unit t), RTT is updated: RTT = α RTT + (1 - α) t α is a smoothing factor, typically The choice of the timeout is based on RTT: Timeout = β RTT At the beginning, β was chose as 2, but this was too inflexible Page 32

33 Retransmission Timer Improvement (Jacobsson): select β proportionally to the standard deviation of the arrival time of acknowledgements Computation of β: β = α β + (1 - α) RTT - t The factor α does not need to be the same as during the RTT computation Standard timeout interval: Timeout = RTT + 4 β The factor 4 was determined on the one hand by trying out, on the other hand because it is fast and simple to use in computations. Alternative, very simple proposal, which is used in most TCP implementations: Double the timeout as long as an acknowledgement arrives in time. Page 33

34 Working with TCP Server side The receiving application process (server) has to run at first The server provides a socket over which connection requests are received (i.e. a port is made available) In order to be able to receive requests of several clients, the server provides a new socket for a connection request of each client Client side The client generates a socket The client creates a request with IP address and port of the server When the client creates its socket, a connection establishment to the server is made Page 34

35 Socket Primitives in TCP For communication via TCP, a set of primitives exists which an application programmer can use for initializing and carrying out a communication. The essential primitives are: Primitively SOCKET BIND LISTEN ACCEPT CONNECT SEND RECEIVE CLOSE Meaning Creation of a new network access point Assign a local address with the socket Wait for arriving connecting requests Accept a connecting request Attempt of a connection establishment Send data over the connection Receive data on the connection Release of the connection Page 35

36 Socket Programming in TCP Server (on host hostid) create socket, port=x, for incoming request: welcomesocket = ServerSocket () TCP wait for incoming Connection establishment connection request connectionsocket = welcomesocket.accept () read request from connectionsocket write reply to connectionsocket close connectionsocket Client create socket, connect to hostid, port=x clientsocket = Socket () send request using clientsocket read reply from clientsocket close clientsocket Page 36

37 Example: Java Client (TCP) import java.io.*; import java.net.*; class TCPClient { Buffers for user input are provided Create client socket, establish connection Create data stream for the socket public static void main(string argv[]) throws Exception { String sentence; String modifiedsentence; BufferedReader infromuser = new BufferedReader(new InputStreamReader(System.in)); Socket clientsocket = new Socket( hostname, 6789); CONNECT DataOutputStream outtoserver = new DataOutputStream(clientSocket.getOutputStream ()); Page 37

38 Example: Java Client (TCP) Create data stream from the socket BufferedReader infromserver = new BufferedReader(new InputStreamReader(clientSocket.getInputStream())); Send to server sentence = infromuser.readline(); outtoserver.writebytes(sentence + \ n ); SEND Receive from server modifiedsentence = infromserver.readline(); RECEIVE System.out.println( FROM SERVER: + modifiedsentence); clientsocket.close(); } } Page 38

39 Example: Java Server (TCP) import java.io.*; import java.net.*; class TCPServer { Provide default socket on port 6789 Wait for incoming connection requests Link buffer with the socket public static void main(string arg []) throws Exception { String clientsentence; String capitalizedsentence; BIND ServerSocket welcomesocket = new ServerSocket(6789); while (true) { LISTEN Socket connectionsocket = welcomesocket.accept(); BufferedReader infromclient = new BufferedReader(new InputStreamReader(connectionSocket.getInputStream())); Page 39

40 Example: Java Server (TCP) Link outgoing data stream with the socket DataOutputStream outtoclient = new DataOutputStream(connectionSocket.getOutputStream()); Read from socket clientsentence = infromclient.readline(); RECEIVE capitalizedsentence = clientsentence.touppercase() + \ n ; Write on socket } } } outtoclient.writebytes(capitalizedsentence); Go back, wait on next request SEND Page 40

41 The User Datagram Protocol (UDP) Alternative to TCP; principle: Keep it simple! 8 byte header Like IP: connectionless and unreliable Small reliability, but fast exchange of information Used for fast data transfer, and for transfer of only short messages (to avoid the connection establishment overhead) No acknowledgement of packets on the UDP layer, incorrect packets simply are discarded. Duplication, sequence order permutation, and packet loss are possible. The checksum offers the only possibility of testing the packets on transfer errors Possible: ACKs and retransmissions are controlled by the application. Use in multicast (not possible with TCP) Why at all a protocol if no function is implemented? Only the addition of a port to a network address marks communication clearly. Page 41

42 UDP Header Lehrstuhl für Informatik 4 Bit Positon Source Port Message Length Destination Port Checksum Data Addressing of the applications by port numbers Message length indicates the overall length (header + data) in 32-bit words Checksum (optional!) IP does not have a checksum for the data part, therefore it can be a meaningful addition here. Execution of the computation as for TCP Data are filled up if necessary to an even byte number (because Message Length is indicated in 32-bit words) Page 42

43 UDP-based Applications Automatic Address Assignment Routing Information Name service Network Management DNS BOOTP File Transfer TFTP SNMP RIP 53 67/ / Well known UDP ports (up to 1023) Page 43

44 Socket Programming with UDP Server (on host hostid) Client create socket, port=x, for incoming request: serversocket = DatagramSocket() read request from serversocket create socket, clientsocket = DatagramSocket() Create, address (hostid, port=x), send datagram request using clientsocket write reply to serversocket specifying client host address, port number read reply from clientsocket close clientsocket Page 44

45 Example: Java Client (UDP) import java.io.*; import java.net.*; Provide buffer for input data stream Create client socket Translate hostname into IP address class UDPClient { public static void main(string arg []) throws Exception { BufferedReader infromuser = new BufferedReader(new InputStreamReader(System.in)); DatagramSocket clientsocket = new DatagramSocket(); InetAddress IPAddress = InetAddress.getByName( hostname ); byte[] senddata = new byte[1024]; byte[] receivedata = new byte[1024]; String sentence = infromuser.readline(); senddata = sentence.getbytes (); Page 45

46 Example: Java Client (UDP) Create datagram Send datagram Read datagram from the server DatagramPacket send-pack = new DatagramPacket(sendData, senddata.length, IPAddress, 9876); clientsocket.send(send-pack); DatagramPacket receivepacket = new DatagramPacket(receiveData, receivedata.length); clientsocket.receive(receivepacket); String modifiedsentence = new String(receivePacket.getData()); } System.out.println( FROM SERVER: + modifiedsentence); clientsocket.close(); } Page 46

47 Example: Java Server (UDP) import java.io.*; import java.net.*; Create datagram socket class UDPServer { public static void main(string args[]) throws Exception { DatagramSocket serversocket = new DatagramSocket(9876); byte[] receivedata = new byte[1024]; byte[] senddata = new byte[1024]; Reserve buffer for received datagrams Receive datagram while (true) { DatagramPacket receivepacket = new DatagramPacket(receiveData, receivedata.length); serversocket.receive(receivepacket); Page 47

48 Example: Java Server (UDP) String sentence = new String(receivePacket.getData()); Get IP address and port of the client InetAddress IPAddress = receivepacket.getaddress(); int port = receivepacket.getport(); String capitalizedsentence = sentence.touppercase(); Create datagram for the client Write datagram to socket } } senddata = capitalizedsentence.getbytes(); DatagramPacket sendpacket = new DatagramPacket(sendData, senddata.length, IPAddress, port); serversocket.send(sendpacket); } Wait for the next datagram Page 48

49 Layer 4 Conclusion TCP is used by most application layer protocols (web pages, file transfer, , ), UDP is used if the connection establishment causes too much overhead (network management, name service, ) If speed is important, also UDP is to be preferred (nevertheless, for Internet radio, implementations for both protocols exist) Also further layer 4 protocols were developed but have not become prominent except RTP: RTP sits on top of UDP (still a layer 4 protocol) Adds no control functionality Adds additional header information for providing information like sequence numbers Applications can use of RTP to make use of these information for implementing own control functionality Thus, using RTP allows an application for a trade-off between speed and reliability Page 49

50 Implementation Example In the following: exemplarily implementation of a simplified TCP-like transport protocol, which covers the following segment types: TPDU CALL REQUEST CALL ACCEPTED CLEAR REQUEST CLEAR CONFIRMATION DATA CREDIT Meaning Attempt of a connection establishment Answer to CALL REQUEST Attempt of a connection termination Answer to CLEAR REQUEST Data transmission Control data for the management of the window size Page 50

51 Implementation Example A connection can have one of the following states: Idle no connection is established. Waiting a CONNECT took place, CALL REQUEST is sent. Queued the CALL REQUEST was received but not yet processed. Established connection establishment finished. Sending wait for transmission permission. Receiving the receiver executed a RECEIVE. Disconnecting local call of DISCONNECT. Page 51

52 Implementation Example Page 52

53 Implementation Example Page 53

54 Implementation Example Page 54

55 Implementation Example Page 55

56 Implementation Example Page 56

57 Implementation Example Page 57

58 Implementation Example Page 58

59 Implementation Example Page 59

60 Representation of the protocol as finite state machine Page 60

61 Implementation Example Representation of protocol as finite State Machine (graphical form) Page 61

Layer 4 - Transport Layer. What do we need a Transport Layer for? Transport Protocols in the TCP/IP Reference Model. The Transport Layer TCP and UDP

Layer 4 - Transport Layer. What do we need a Transport Layer for? Transport Protocols in the TCP/IP Reference Model. The Transport Layer TCP and UDP Layer 4 - Transport Layer Core of the protocol hierarchy: Network-independent, reliable and economical data transfer Tasks of the transport layer: Connection-oriented or connectionless data transfer Addressing

More information

Communication in Distributed Systems: Sockets Programming. Operating Systems

Communication in Distributed Systems: Sockets Programming. Operating Systems Communication in Distributed Systems: Sockets Programming Operating Systems TCP/IP layers Layers Message Application Transport Internet Network interface Messages (UDP) or Streams (TCP) UDP or TCP packets

More information

Introduction to Sockets 9/25/14

Introduction to Sockets 9/25/14 Introduction to Sockets 9/25/14 81 Remote communication Inter-process communication is at the heart of all distributed systems Using the network protocol stack on a node is the only way to communicate

More information

Chapter 2 Application Layer

Chapter 2 Application Layer Chapter 2 Application Layer A note on the use of these ppt slides: We re making these slides freely available to all (faculty, students, readers). They re in PowerPoint form so you can add, modify, and

More information

Chapter 2: outline. 2.1 principles of network applications. 2.6 P2P applications 2.7 socket programming with UDP and TCP

Chapter 2: outline. 2.1 principles of network applications. 2.6 P2P applications 2.7 socket programming with UDP and TCP Chapter 2: outline 2.1 principles of network applications app architectures app requirements 2.2 Web and HTTP 2.3 FTP 2.4 electronic mail SMTP, POP3, IMAP 2.5 DNS 2.6 P2P applications 2.7 socket programming

More information

Chapter 2 outline. 2.1 Principles of app layer protocols

Chapter 2 outline. 2.1 Principles of app layer protocols Chapter 2 outline 2.1 Principles of app layer protocols clients and servers app requirements 2.2 Web and HTTP 2.3 FTP 2.4 Electronic Mail SMTP, POP3, IMAP 2.5 DNS 2.6 Socket programming with TCP 2.7 Socket

More information

CPSC 441 UDP Socket Programming. Department of Computer Science University of Calgary

CPSC 441 UDP Socket Programming. Department of Computer Science University of Calgary CPSC 441 UDP Socket Programming Department of Computer Science University of Calgary Socket programming using UDP (vs TCP) UDP: no connection between client and server vno handshaking vsender explicitly

More information

Chapter 2 Application Layer

Chapter 2 Application Layer Internet and Intranet Protocols and Applications Lecture 4: Application Layer 3: Socket Programming Spring 2006 Arthur Goldberg Computer Science Department New York University artg@cs.nyu.edu Chapter 2

More information

Layer 4 - Transport Layer

Layer 4 - Transport Layer Layer 4 - Transport Layer Core of the protocol hierarchy: Network-independent, reliable and economical data transfer Tasks of the transport layer: Connection-oriented or connectionless data transfer Addressing

More information

Computer Networks Unit II Transport layer (2012 pattern)

Computer Networks Unit II Transport layer (2012 pattern) Computer Networks Unit II Transport layer (2012 pattern) By Prof. B.A.Khivsara Assistant Prof. Department of Computer Engg. SNJB s KBJ COE, Chandwad Introduction 1-1 Chapter 2: ROAD MAP Transport Layer

More information

CSCD 330 Network Programming Spring 2018

CSCD 330 Network Programming Spring 2018 CSCD 330 Network Programming Spring 2018 Lecture 7 Application Layer Socket Programming in Java Reading: Chapter 2, Java links Relevant Links page Some Material in these slides from J.F Kurose and K.W.

More information

CSCD 330 Network Programming Winter 2019

CSCD 330 Network Programming Winter 2019 CSCD 330 Network Programming Winter 2019 Lecture 7 Application Layer Socket Programming in Java Reading: Chapter 2, Java links Relevant Links page Some Material in these slides from J.F Kurose and K.W.

More information

TSIN02 - Internetworking

TSIN02 - Internetworking Lecture 4: Transport Layer Literature: Forouzan: ch 11-12 2004 Image Coding Group, Linköpings Universitet Lecture 4: Outline Transport layer responsibilities UDP TCP 2 Transport layer in OSI model Figure

More information

Computer Networking Introduction

Computer Networking Introduction Computer Networking Introduction Halgurd S. Maghdid Software Engineering Department Koya University-Koya, Kurdistan-Iraq Lecture No.6 Chapter 2: outline 2.1 principles of network applications app architectures

More information

CPSC 441 Tutorial - 11 UDP Socket Programming Department of Computer Science University of Calgary

CPSC 441 Tutorial - 11 UDP Socket Programming Department of Computer Science University of Calgary CPSC 441 Tutorial - 11 UDP Programming Department of Computer Science University of Calgary TCP Vs UDP Input: receives packet (TCP receives byte stream ) Output: sends packet (TCP sends byte stream ) What

More information

TSIN02 - Internetworking

TSIN02 - Internetworking Lecture 4: Transport Layer Literature: Forouzan: ch 11-12 2004 Image Coding Group, Linköpings Universitet Lecture 4: Outline Transport layer responsibilities UDP TCP 2 Transport layer in OSI model Figure

More information

Lecture 3. Java Socket Programming. TCP, UDP and URL

Lecture 3. Java Socket Programming. TCP, UDP and URL Lecture 3 TCP, UDP and URL 1 Java Sockets Programming The package java.net provides support for sockets programming (and more). Typically you import everything defined in this package with: import java.net.*;

More information

Telematics Chapter 8: Transport Layer

Telematics Chapter 8: Transport Layer Telematics Chapter 8: Transport Layer User watching video clip Application Layer Presentation Layer Session Layer Transport Layer Server with video clips Application Layer Presentation Layer Session Layer

More information

TSIN02 - Internetworking

TSIN02 - Internetworking Lecture 4: Outline Literature: Lecture 4: Transport Layer Forouzan: ch 11-12 RFC? Transport layer introduction UDP TCP 2004 Image Coding Group, Linköpings Universitet 2 The Transport Layer Transport layer

More information

Lecture 05: Application Layer (Part 02) FTP, Peer-to-Peer, . Dr. Anis Koubaa

Lecture 05: Application Layer (Part 02) FTP, Peer-to-Peer,  . Dr. Anis Koubaa NET 331 Computer Networks Lecture 05: Application Layer (Part 02) FTP, Peer-to-Peer, Email Dr. Anis Koubaa Reformatted slides from textbook Computer Networking a top-down appraoch, Fifth Edition by Kurose

More information

TSIN02 - Internetworking

TSIN02 - Internetworking TSIN02 - Internetworking Literature: Lecture 4: Transport Layer Forouzan: ch 11-12 Transport layer responsibilities UDP TCP 2004 Image Coding Group, Linköpings Universitet 2 Transport layer in OSI model

More information

CSCD 330 Network Programming Spring 2018

CSCD 330 Network Programming Spring 2018 CSCD 330 Network Programming Spring 2018 Lecture 6 Application Layer Socket Programming in Java Reading for Java Client/Server see Relevant Links Some Material in these slides from J.F Kurose and K.W.

More information

6.1 Internet Transport Layer Architecture 6.2 UDP (User Datagram Protocol) 6.3 TCP (Transmission Control Protocol) 6. Transport Layer 6-1

6.1 Internet Transport Layer Architecture 6.2 UDP (User Datagram Protocol) 6.3 TCP (Transmission Control Protocol) 6. Transport Layer 6-1 6. Transport Layer 6.1 Internet Transport Layer Architecture 6.2 UDP (User Datagram Protocol) 6.3 TCP (Transmission Control Protocol) 6. Transport Layer 6-1 6.1 Internet Transport Layer Architecture The

More information

CS 355. Computer Networking. Wei Lu, Ph.D., P.Eng.

CS 355. Computer Networking. Wei Lu, Ph.D., P.Eng. CS 355 Computer Networking Wei Lu, Ph.D., P.Eng. Chapter 2: Application Layer Overview: Principles of network applications? Introduction to Wireshark Web and HTTP FTP Electronic Mail: SMTP, POP3, IMAP

More information

Lecture 3: The Transport Layer: UDP and TCP

Lecture 3: The Transport Layer: UDP and TCP Lecture 3: The Transport Layer: UDP and TCP Prof. Shervin Shirmohammadi SITE, University of Ottawa Prof. Shervin Shirmohammadi CEG 4395 3-1 The Transport Layer Provides efficient and robust end-to-end

More information

Lecture 20 Overview. Last Lecture. This Lecture. Next Lecture. Transport Control Protocol (1) Transport Control Protocol (2) Source: chapters 23, 24

Lecture 20 Overview. Last Lecture. This Lecture. Next Lecture. Transport Control Protocol (1) Transport Control Protocol (2) Source: chapters 23, 24 Lecture 20 Overview Last Lecture Transport Control Protocol (1) This Lecture Transport Control Protocol (2) Source: chapters 23, 24 Next Lecture Internet Applications Source: chapter 26 COSC244 & TELE202

More information

Transport Protocols. Raj Jain. Washington University in St. Louis

Transport Protocols. Raj Jain. Washington University in St. Louis Transport Protocols Raj Jain Washington University Saint Louis, MO 63131 Jain@cse.wustl.edu These slides are available on-line at: http://www.cse.wustl.edu/~jain/cse473-05/ 16-1 Overview q TCP q Key features

More information

Computer Networks. 2.Application Layer. László Böszörményi Computer Networks Application Layer - 1

Computer Networks. 2.Application Layer. László Böszörményi Computer Networks Application Layer - 1 Computer Networks 2.Application Layer László Böszörményi Computer Networks Application Layer - 1 Applications + App Layer Protocols Applications, app. processes E.g., E-mail, WWW, DNS, P2P file sharing,

More information

Process Communication COMPUTER NETWORKING Part 2

Process Communication COMPUTER NETWORKING Part 2 Process Communication COMPUTER NETWORKING Part 2 Client-server paradigm and Socket Programming ch 18 Thanks to the authors of the textbook [USP] and [KR] for providing the base slides. I made several changes/additions.

More information

Transport Layer. Application / Transport Interface. Transport Layer Services. Transport Layer Connections

Transport Layer. Application / Transport Interface. Transport Layer Services. Transport Layer Connections Application / Transport Interface Application requests service from transport layer Transport Layer Application Layer Prepare Transport service requirements Data for transport Local endpoint node address

More information

Guide To TCP/IP, Second Edition UDP Header Source Port Number (16 bits) IP HEADER Protocol Field = 17 Destination Port Number (16 bit) 15 16

Guide To TCP/IP, Second Edition UDP Header Source Port Number (16 bits) IP HEADER Protocol Field = 17 Destination Port Number (16 bit) 15 16 Guide To TCP/IP, Second Edition Chapter 5 Transport Layer TCP/IP Protocols Objectives Understand the key features and functions of the User Datagram Protocol (UDP) Explain the mechanisms that drive segmentation,

More information

Transport Over IP. CSCI 690 Michael Hutt New York Institute of Technology

Transport Over IP. CSCI 690 Michael Hutt New York Institute of Technology Transport Over IP CSCI 690 Michael Hutt New York Institute of Technology Transport Over IP What is a transport protocol? Choosing to use a transport protocol Ports and Addresses Datagrams UDP What is a

More information

CMSC 417. Computer Networks Prof. Ashok K Agrawala Ashok Agrawala. October 25, 2018

CMSC 417. Computer Networks Prof. Ashok K Agrawala Ashok Agrawala. October 25, 2018 CMSC 417 Computer Networks Prof. Ashok K Agrawala 2018 Ashok Agrawala Message, Segment, Packet, and Frame host host HTTP HTTP message HTTP TCP TCP segment TCP router router IP IP packet IP IP packet IP

More information

JAVA SOCKET PROGRAMMING

JAVA SOCKET PROGRAMMING JAVA SOCKET PROGRAMMING WHAT IS A SOCKET? Socket The combination of an IP address and a port number. (RFC 793 original TCP specification) The name of the Berkeley-derived application programming interfaces

More information

Transport Protocols and TCP

Transport Protocols and TCP Transport Protocols and TCP Functions Connection establishment and termination Breaking message into packets Error recovery ARQ Flow control Multiplexing, de-multiplexing Transport service is end to end

More information

Transport Layer. -UDP (User Datagram Protocol) -TCP (Transport Control Protocol)

Transport Layer. -UDP (User Datagram Protocol) -TCP (Transport Control Protocol) Transport Layer -UDP (User Datagram Protocol) -TCP (Transport Control Protocol) 1 Transport Services The transport layer has the duty to set up logical connections between two applications running on remote

More information

TCP/IP Networking. Part 4: Network and Transport Layer Protocols

TCP/IP Networking. Part 4: Network and Transport Layer Protocols TCP/IP Networking Part 4: Network and Transport Layer Protocols Orientation Application Application protocol Application TCP TCP protocol TCP IP IP protocol IP IP protocol IP IP protocol IP Network Access

More information

User Datagram Protocol (UDP):

User Datagram Protocol (UDP): SFWR 4C03: Computer Networks and Computer Security Feb 2-5 2004 Lecturer: Kartik Krishnan Lectures 13-15 User Datagram Protocol (UDP): UDP is a connectionless transport layer protocol: each output operation

More information

Network Technology 1 5th - Transport Protocol. Mario Lombardo -

Network Technology 1 5th - Transport Protocol. Mario Lombardo - Network Technology 1 5th - Transport Protocol Mario Lombardo - lombardo@informatik.dhbw-stuttgart.de 1 overview Transport Protocol Layer realizes process to process communication data unit is called a

More information

Transport Layer. <protocol, local-addr,local-port,foreign-addr,foreign-port> ϒ Client uses ephemeral ports /10 Joseph Cordina 2005

Transport Layer. <protocol, local-addr,local-port,foreign-addr,foreign-port> ϒ Client uses ephemeral ports /10 Joseph Cordina 2005 Transport Layer For a connection on a host (single IP address), there exist many entry points through which there may be many-to-many connections. These are called ports. A port is a 16-bit number used

More information

ECE 650 Systems Programming & Engineering. Spring 2018

ECE 650 Systems Programming & Engineering. Spring 2018 ECE 650 Systems Programming & Engineering Spring 2018 Networking Transport Layer Tyler Bletsch Duke University Slides are adapted from Brian Rogers (Duke) TCP/IP Model 2 Transport Layer Problem solved:

More information

User Datagram Protocol

User Datagram Protocol Topics Transport Layer TCP s three-way handshake TCP s connection termination sequence TCP s TIME_WAIT state TCP and UDP buffering by the socket layer 2 Introduction UDP is a simple, unreliable datagram

More information

TCP and UDP Socket Programming in JAVA TCP Socket Programming 1. Write code for Client and save in GreetingClient.java

TCP and UDP Socket Programming in JAVA TCP Socket Programming 1. Write code for Client and save in GreetingClient.java TCP Socket Programming 1. Write code for Client and save in GreetingClient.java // File Name GreetingClient.java public class GreetingClient public static void main(string [] args) String servername =

More information

Chapter 2: Application Layer last updated 22/09/03

Chapter 2: Application Layer last updated 22/09/03 Chapter 2: Application Layer last updated 22/09/03 Chapter goals: conceptual + implementation aspects of network application protocols client server paradigm service models learn about protocols by examining

More information

OSI Transport Layer. objectives

OSI Transport Layer. objectives LECTURE 5 OSI Transport Layer objectives 1. Roles of the Transport Layer 1. segmentation of data 2. error detection 3. Multiplexing of upper layer application using port numbers 2. The TCP protocol Communicating

More information

Networking Technologies and Applications

Networking Technologies and Applications Networking Technologies and Applications Rolland Vida BME TMIT Transport Protocols UDP User Datagram Protocol TCP Transport Control Protocol and many others UDP One of the core transport protocols Used

More information

Client/Server Computing & Socket Programming

Client/Server Computing & Socket Programming CPSC 852 Intering Client/Server Computing & Socket Programming Michele Weigle Department of Computer Science Clemson University mweigle@cs.clemson.edu http://www.cs.clemson.edu/~mweigle/courses/cpsc852

More information

EEC-682/782 Computer Networks I

EEC-682/782 Computer Networks I EEC-682/782 Computer Networks I Lecture 16 Wenbing Zhao w.zhao1@csuohio.edu http://academic.csuohio.edu/zhao_w/teaching/eec682.htm (Lecture nodes are based on materials supplied by Dr. Louise Moser at

More information

Part 2: Application Layer

Part 2: Application Layer Part 2: Application Layer Our goals: conceptual, implementation aspects of network application protocols client-server paradigm service models learn about protocols by examining popular application-level

More information

Suprakash Datta. Office: CSEB 3043 Phone: ext Course page:

Suprakash Datta. Office: CSEB 3043 Phone: ext Course page: CSE 3214: Computer Networks Protocols and Applications Suprakash Datta datta@cse.yorku.ca Office: CSEB 3043 Phone: 416-736-2100 ext 77875 Course page: http://www.cse.yorku.ca/course/3214 These slides are

More information

Unit 2.

Unit 2. Unit 2 Unit 2 Topics Covered: 1. PROCESS-TO-PROCESS DELIVERY 1. Client-Server 2. Addressing 2. IANA Ranges 3. Socket Addresses 4. Multiplexing and Demultiplexing 5. Connectionless Versus Connection-Oriented

More information

ICMP. Outline ICMP. ICMP oicmp is provided within IP which generates error. Internet Control Message Protocol. Ping Traceroute

ICMP. Outline ICMP. ICMP oicmp is provided within IP which generates error. Internet Control Message Protocol. Ping Traceroute Outline ICMP Internet Control Message Protocol oicmp Basic o ICMP Packet oicmp Types & Code Ping Traceroute 2 3 ICMP oicmp is provided within IP which generates error messages to help the IP layers (best

More information

Transport Layer. Gursharan Singh Tatla. Upendra Sharma. 1

Transport Layer. Gursharan Singh Tatla.   Upendra Sharma. 1 Transport Layer Gursharan Singh Tatla mailme@gursharansingh.in Upendra Sharma 1 Introduction The transport layer is the fourth layer from the bottom in the OSI reference model. It is responsible for message

More information

NWEN 243. Networked Applications. Layer 4 TCP and UDP

NWEN 243. Networked Applications. Layer 4 TCP and UDP NWEN 243 Networked Applications Layer 4 TCP and UDP 1 About the second lecturer Aaron Chen Office: AM405 Phone: 463 5114 Email: aaron.chen@ecs.vuw.ac.nz Transport layer and application layer protocols

More information

QUIZ: Longest Matching Prefix

QUIZ: Longest Matching Prefix QUIZ: Longest Matching Prefix A router has the following routing table: 10.50.42.0 /24 Send out on interface Z 10.50.20.0 /24 Send out on interface A 10.50.24.0 /22 Send out on interface B 10.50.20.0 /22

More information

Chapter 2 - Part 1. The TCP/IP Protocol: The Language of the Internet

Chapter 2 - Part 1. The TCP/IP Protocol: The Language of the Internet Chapter 2 - Part 1 The TCP/IP Protocol: The Language of the Internet Protocols A protocol is a language or set of rules that two or more computers use to communicate 2 Protocol Analogy: Phone Call Parties

More information

Connection-oriented (virtual circuit) Reliable Transfer Buffered Transfer Unstructured Stream Full Duplex Point-to-point Connection End-to-end service

Connection-oriented (virtual circuit) Reliable Transfer Buffered Transfer Unstructured Stream Full Duplex Point-to-point Connection End-to-end service 최양희서울대학교컴퓨터공학부 Connection-oriented (virtual circuit) Reliable Transfer Buffered Transfer Unstructured Stream Full Duplex Point-to-point Connection End-to-end service 1 2004 Yanghee Choi 2 Addressing: application

More information

Introduction to Networks and the Internet

Introduction to Networks and the Internet Introduction to Networks and the Internet CMPE 80N Announcements Project 2. Reference page. Library presentation. Internet History video. Spring 2003 Week 7 1 2 Today Internetworking (cont d). Fragmentation.

More information

05 Transmission Control Protocol (TCP)

05 Transmission Control Protocol (TCP) SE 4C03 Winter 2003 05 Transmission Control Protocol (TCP) Instructor: W. M. Farmer Revised: 06 February 2003 1 Interprocess Communication Problem: How can a process on one host access a service provided

More information

7. TCP 최양희서울대학교컴퓨터공학부

7. TCP 최양희서울대학교컴퓨터공학부 7. TCP 최양희서울대학교컴퓨터공학부 1 TCP Basics Connection-oriented (virtual circuit) Reliable Transfer Buffered Transfer Unstructured Stream Full Duplex Point-to-point Connection End-to-end service 2009 Yanghee Choi

More information

Chapter 3- parte B outline

Chapter 3- parte B outline Chapter 3- parte B outline 3.1 transport-layer services 3.2 multiplexing and demultiplexing 3.3 connectionless transport: UDP 3.4 principles of reliable data transfer 3.5 connection-oriented transport:

More information

IS370 Data Communications and Computer Networks. Chapter 5 : Transport Layer

IS370 Data Communications and Computer Networks. Chapter 5 : Transport Layer IS370 Data Communications and Computer Networks Chapter 5 : Transport Layer Instructor : Mr Mourad Benchikh Introduction Transport layer is responsible on process-to-process delivery of the entire message.

More information

ECE4110 Internetwork Programming. Introduction and Overview

ECE4110 Internetwork Programming. Introduction and Overview ECE4110 Internetwork Programming Introduction and Overview 1 EXAMPLE GENERAL NETWORK ALGORITHM Listen to wire Are signals detected Detect a preamble Yes Read Destination Address No data carrying or noise?

More information

Transport Layer Protocols. Internet Transport Layer. Agenda. TCP Fundamentals

Transport Layer Protocols. Internet Transport Layer. Agenda. TCP Fundamentals Transport Layer Protocols Application SMTP HTTP FTP Telnet DNS BootP DHCP ( M I M E ) Presentation Session SNMP TFTP Internet Transport Layer TCP Fundamentals, TCP Performance Aspects, UDP (User Datagram

More information

Transport Protocols & TCP TCP

Transport Protocols & TCP TCP Transport Protocols & TCP CSE 3213 Fall 2007 13 November 2007 1 TCP Services Flow control Connection establishment and termination Congestion control 2 1 TCP Services Transmission Control Protocol (RFC

More information

Transport layer. UDP: User Datagram Protocol [RFC 768] Review principles: Instantiation in the Internet UDP TCP

Transport layer. UDP: User Datagram Protocol [RFC 768] Review principles: Instantiation in the Internet UDP TCP Transport layer Review principles: Reliable data transfer Flow control Congestion control Instantiation in the Internet UDP TCP 1 UDP: User Datagram Protocol [RFC 768] No frills, bare bones Internet transport

More information

Chapter 6. What happens at the Transport Layer? Services provided Transport protocols UDP TCP Flow control Congestion control

Chapter 6. What happens at the Transport Layer? Services provided Transport protocols UDP TCP Flow control Congestion control Chapter 6 What happens at the Transport Layer? Services provided Transport protocols UDP TCP Flow control Congestion control OSI Model Hybrid Model Software outside the operating system Software inside

More information

Transport Layer: outline

Transport Layer: outline Transport Layer: outline Transport-layer services Multiplexing and demultiplexing Connectionless transport: UDP Principles of reliable data transfer Connection-oriented transport: TCP Segment structure

More information

Chapter 3 outline. 3.5 connection-oriented transport: TCP segment structure reliable data transfer flow control connection management

Chapter 3 outline. 3.5 connection-oriented transport: TCP segment structure reliable data transfer flow control connection management Chapter 3 outline 3.1 transport-layer services 3.2 multiplexing and demultiplexing 3.3 connectionless transport: UDP 3.4 principles of reliable data transfer 3.5 connection-oriented transport: TCP segment

More information

Transport layer. Review principles: Instantiation in the Internet UDP TCP. Reliable data transfer Flow control Congestion control

Transport layer. Review principles: Instantiation in the Internet UDP TCP. Reliable data transfer Flow control Congestion control Transport layer Review principles: Reliable data transfer Flow control Congestion control Instantiation in the Internet UDP TCP 1 UDP: User Datagram Protocol [RFC 768] No frills, bare bones Internet transport

More information

UDP and TCP. Introduction. So far we have studied some data link layer protocols such as PPP which are responsible for getting data

UDP and TCP. Introduction. So far we have studied some data link layer protocols such as PPP which are responsible for getting data ELEX 4550 : Wide Area Networks 2015 Winter Session UDP and TCP is lecture describes the two most common transport-layer protocols used by IP networks: the User Datagram Protocol (UDP) and the Transmission

More information

Chapter 3 Transport Layer

Chapter 3 Transport Layer Chapter 3 Transport Layer Part b Connection-Oriented Transport Transport Layer 3-1 Chapter 3 outline 3.1 transport-layer services 3.2 multiplexing and demultiplexing 3.3 connectionless transport: UDP 3.4

More information

Chapter 24. Transport-Layer Protocols

Chapter 24. Transport-Layer Protocols Chapter 24. Transport-Layer Protocols 23.1 Introduction 23.2 User Datagram Protocol 23.3 Transmission Control Protocol 23.4 SCTP Computer Networks 24-1 Position of Transport-Layer Protocols UDP is an unreliable

More information

10 minutes survey (anonymous)

10 minutes survey (anonymous) 10 minutes survey (anonymous) v Comments/Suggestions to my lecture/lab/ homework/exam v If you like this course, which part do you like? v If you don t like it, which part do you not like? Thanks! Transport

More information

Transmission Control Protocol (TCP)

Transmission Control Protocol (TCP) Transmission Control Protocol (TCP) Antonio Carzaniga Faculty of Informatics University of Lugano May 3, 2005 Outline Intro to TCP Sequence numbers and acknowledgment numbers Timeouts and RTT estimation

More information

CMPE 150/L : Introduction to Computer Networks. Chen Qian Computer Engineering UCSC Baskin Engineering Lecture 9

CMPE 150/L : Introduction to Computer Networks. Chen Qian Computer Engineering UCSC Baskin Engineering Lecture 9 CMPE 150/L : Introduction to Computer Networks Chen Qian Computer Engineering UCSC Baskin Engineering Lecture 9 1 Chapter 3 outline 3.1 transport-layer services 3.2 multiplexing and demultiplexing 3.3

More information

Chapter 6. (Week 12) The Transport Layer (CONTINUATION) ANDREW S. TANENBAUM COMPUTER NETWORKS FOURTH EDITION PP

Chapter 6. (Week 12) The Transport Layer (CONTINUATION) ANDREW S. TANENBAUM COMPUTER NETWORKS FOURTH EDITION PP Chapter 6 (Week 12) The Transport Layer (CONTINUATION) ANDREW S. TANENBAUM COMPUTER NETWORKS FOURTH EDITION PP. 524-574 1 THE TRANSPORT LAYER S TASK IS TO PROVIDE RELIABLE, COST- EFFECTIVE DATA TRANSPORT

More information

CS4700/CS5700 Fundamentals of Computer Networks

CS4700/CS5700 Fundamentals of Computer Networks CS4700/CS5700 Fundamentals of Computer Networks Lecture 14: TCP Slides used with permissions from Edward W. Knightly, T. S. Eugene Ng, Ion Stoica, Hui Zhang Alan Mislove amislove at ccs.neu.edu Northeastern

More information

EEC-484/584 Computer Networks. Lecture 16. Wenbing Zhao

EEC-484/584 Computer Networks. Lecture 16. Wenbing Zhao EEC-484/584 Computer Networks Lecture 16 wenbing@ieee.org (Lecture nodes are based on materials supplied by Dr. Louise Moser at UCSB and Prentice-Hall) Outline 2 Review Services provided by transport layer

More information

The Transport Layer Reliable data delivery & flow control in TCP. Transport Layer Protocols & Services Outline

The Transport Layer Reliable data delivery & flow control in TCP. Transport Layer Protocols & Services Outline CPSC 852 Internetworking The Transport Layer Reliable data delivery & flow control in TCP Michele Weigle Department of Computer Science Clemson University mweigle@cs.clemson.edu http://www.cs.clemson.edu/~mweigle/courses/cpsc852

More information

Transport Layer: Outline

Transport Layer: Outline Transport Layer: Outline Transport-layer services Multiplexing and demultiplexing Connectionless transport: UDP Principles of reliable data transfer Connection-oriented transport: TCP Segment structure

More information

Transmission Control Protocol. ITS 413 Internet Technologies and Applications

Transmission Control Protocol. ITS 413 Internet Technologies and Applications Transmission Control Protocol ITS 413 Internet Technologies and Applications Contents Overview of TCP (Review) TCP and Congestion Control The Causes of Congestion Approaches to Congestion Control TCP Congestion

More information

Jaringan Komputer. The Transport Layer

Jaringan Komputer. The Transport Layer Jaringan Komputer Transport Layer The Transport Layer The heart of the whole protocol hierarchy Task: To provide reliable, cost-effective data transport from the source machine to the destination machine,

More information

Πρωτόκολλα Διαδικτύου (ΨΣ-326 DS151)

Πρωτόκολλα Διαδικτύου (ΨΣ-326 DS151) ΠΑΝΕΠΙΣΤΗΜΙΟ ΠΕΙΡΑΙΩΣ ΤΜΗΜΑ ΨΗΦΙΑΚΩΝ ΣΥΣΤΗΜΑΤΩΝ Πρωτόκολλα Διαδικτύου (ΨΣ-326 DS151) 3 Η ΕΡΓΑΣΤΗΡΙΑΚΗ ΔΙΑΛΕΞΗ (SOCKET PROGRAMMING) Υπεύθυνος καθηγητής: Άγγελος Ρούσκας Βοηθός: Υ.Δ. Ευθύμης Οικονόμου Πέμπτη

More information

ECE 435 Network Engineering Lecture 9

ECE 435 Network Engineering Lecture 9 ECE 435 Network Engineering Lecture 9 Vince Weaver http://web.eece.maine.edu/~vweaver vincent.weaver@maine.edu 2 October 2018 Announcements HW#4 was posted, due Thursday 1 HW#3 Review md5sum/encryption,

More information

NT1210 Introduction to Networking. Unit 10

NT1210 Introduction to Networking. Unit 10 NT1210 Introduction to Networking Unit 10 Chapter 10, TCP/IP Transport Objectives Identify the major needs and stakeholders for computer networks and network applications. Compare and contrast the OSI

More information

CSE 4213: Computer Networks II

CSE 4213: Computer Networks II Next CSE 4213: Computer Networks II The layer Suprakash Datta datta@cs.yorku.ca Office: CSEB 3043 Phone: 416-736-2100 ext 77875 Course page: http://www.cs.yorku.ca/course/4213 These slides are adapted

More information

Lecture 08: The Transport Layer (Part 2) The Transport Layer Protocol (TCP) Dr. Anis Koubaa

Lecture 08: The Transport Layer (Part 2) The Transport Layer Protocol (TCP) Dr. Anis Koubaa NET 331 Computer Networks Lecture 08: The Transport Layer (Part 2) The Transport Layer Protocol (TCP) Dr. Anis Koubaa Reformatted slides from textbook Computer Networking a top-down appraoch, Fifth Edition

More information

CSC 401 Data and Computer Communications Networks

CSC 401 Data and Computer Communications Networks CSC 401 Data and Computer Communications Networks Transport Layer Connection Oriented Transport: TCP Sec 3.5 Prof. Lina Battestilli Fall 2017 Transport Layer Chapter 3 Outline 3.1 Transport-layer Services

More information

CMPE 150 Winter 2009

CMPE 150 Winter 2009 CMPE 150 Winter 2009 Lecture 16 March 3, 2009 P.E. Mantey CMPE 150 -- Introduction to Computer Networks Instructor: Patrick Mantey mantey@soe.ucsc.edu http://www.soe.ucsc.edu/~mantey/ / t / Office: Engr.

More information

TCP : Fundamentals of Computer Networks Bill Nace

TCP : Fundamentals of Computer Networks Bill Nace TCP 14-740: Fundamentals of Computer Networks Bill Nace Material from Computer Networking: A Top Down Approach, 6 th edition. J.F. Kurose and K.W. Ross Administrivia Lab #1 due now! Reminder: Paper Review

More information

Congestion / Flow Control in TCP

Congestion / Flow Control in TCP Congestion and Flow Control in 1 Flow Control and Congestion Control Flow control Sender avoids overflow of receiver buffer Congestion control All senders avoid overflow of intermediate network buffers

More information

The Transport Layer Reliable data delivery & flow control in TCP. Transport Layer Protocols & Services Outline

The Transport Layer Reliable data delivery & flow control in TCP. Transport Layer Protocols & Services Outline CPSC 360 Network Programming The Transport Layer Reliable data delivery & flow control in TCP Michele Weigle Department of Computer Science Clemson University mweigle@cs.clemson.edu http://www.cs.clemson.edu/~mweigle/courses/cpsc360

More information

Introduction to Protocols

Introduction to Protocols Chapter 6 Introduction to Protocols 1 Chapter 6 Introduction to Protocols What is a Network Protocol? A protocol is a set of rules that governs the communications between computers on a network. These

More information

Computer Networking Introduction

Computer Networking Introduction Computer Networking Introduction Halgurd S. Maghdid Software Engineering Department Koya University-Koya, Kurdistan-Iraq Lecture No.10 Chapter 3 outline 3.1 transport-layer services 3.2 multiplexing and

More information

CCNA Exploration Network Fundamentals. Chapter 04 OSI Transport Layer

CCNA Exploration Network Fundamentals. Chapter 04 OSI Transport Layer CCNA Exploration Network Fundamentals Chapter 04 OSI Transport Layer Updated: 05/05/2008 1 4.1 Roles of the Transport Layer 2 4.1 Roles of the Transport Layer The OSI Transport layer accept data from the

More information

Unit 1 Java Networking

Unit 1 Java Networking Q1. What is Server Socket? Discuss the difference between the Socket and ServerSocket class. The ServerSocket class (java.net) can be used to create a server socket. This object is used to establish communication

More information

Computer Communication Networks Midterm Review

Computer Communication Networks Midterm Review Computer Communication Networks Midterm Review ICEN/ICSI 416 Fall 2018 Prof. Aveek Dutta 1 Instructions The exam is closed book, notes, computers, phones. You can use calculator, but not one from your

More information

Sequence Number. Acknowledgment Number. Data

Sequence Number. Acknowledgment Number. Data CS 455 TCP, Page 1 Transport Layer, Part II Transmission Control Protocol These slides are created by Dr. Yih Huang of George Mason University. Students registered in Dr. Huang's courses at GMU can make

More information

CSC 634: Networks Programming

CSC 634: Networks Programming CSC 634: Networks Programming Lecture 03: Review of Basic Networking Concepts (TCP/UDP) Instructor: Haidar M. Harmanani Recap 7-Layer OSI Model 7 6 5 4 3 2 1 Application Presentation (kinds of compression)

More information