Presentation is loading. Please wait.

Presentation is loading. Please wait.

TCP Transport layer Er. Vikram Dhiman LPU.

Similar presentations


Presentation on theme: "TCP Transport layer Er. Vikram Dhiman LPU."— Presentation transcript:

1 TCP Transport layer Er. Vikram Dhiman LPU

2 Discussion from last topic

3

4

5 Process-la-Process Delivery: UDp, TCp,
Er. Vikram Dhiman

6 The Internet model has three protocols at the transport layer: UDP, TCP, and SCTP.
The data link layer is responsible for delivery of frames between two neighboring nodes over a link. This is called node-to-node delivery. The network layer is responsible for delivery of datagrams between two hosts. This is called host-to-host delivery. Communication on the Internet is not defined as the exchange of data between two nodes or between two hosts.

7 Real communication takes place between two processes (application programs).
We need process-to-process delivery. However, at any moment, several processes may be running on the source host and several on the destination host. To complete the delivery, we need a mechanism to deliver data from one of these processes running on the source host to the corresponding process running on the destination host.

8 Connectionless Versus Connection-Oriented Service
A transport layer protocol can either be connectionless or connection-oriented.

9 Reliable Versus Unreliable
The transport layer service can be reliable or unreliable. If the application layer program needs reliability, we use a reliable transport layer protocol by implementing flow and error control at the transport layer. This means a slower and more complex service

10 if the application program does not need reliability because it uses its own flow and error control mechanism or it needs fast service or the nature of the service does not demand flow and error control (real-time applications), then an unreliable protocol can be used.

11 One question often comes to the mind.
If the data link layer is reliable and has flow and error control, do we need this at the transport layer, too? The answer is yes. Reliability at the data link layer is between two nodes; we need reliability between two ends. Because the network layer in the Internet is unreliable (best-effort delivery), we need to implement reliability at the transport layer.

12 Error control in data link and transport layer
As we will see, flow and error control in TCP is implemented by the sliding window protocol,

13 UDP The User Datagram Protocol (UDP) is called a connectionless, unreliable transport protocol. It does not add anything to the services of IP except to provide process-to process communication instead of host-to-host communication. Also, it performs very limited error checking.

14 If UDP is so powerless, why would a process want to use it?
UDP is a very simple protocol using a minimum of overhead. If a process wants to send a small message and does not care much about reliability, it can use UDP. Sending a small message by using UDP takes much less interaction between the sender and receiver than using TCP or SCT

15 Well Know Port No.

16 UDP Destination port number. This is the port number used by the process running on the destination host. It is also 16 bits long There is a field in the IP datagram that defines the total length. There is another field in the IP datagram that defines the length of the header. So if we subtract the value of the second field from the first, we can deduce the length of a UDP datagram that is encapsulated in an IP datagram. The length field in a UDP user datagram is actually not necessary. A user datagram is encapsulated in an IP datagram

17

18

19 PROCESS-TO-PROCESS DELIVERY
The transport layer is responsible for process-to-process delivery—the delivery of a packet, part of a message, from one process to another. Two processes communicate in a client/server relationship,

20 The transport layer is responsible for process-to-process delivery.
Note The transport layer is responsible for process-to-process delivery.

21 Figure 23.1 Types of data deliveries

22 Client, server 1. Local host 2. Local process 3. Remote host 4. Remote process

23 lANA Ranges The lANA (Internet Assigned Number Authority) has divided the port numbers into three ranges: well known, registered, and dynamic (or private) o Well-known ports. The ports ranging from 0 to 1023 are assigned and controlled by lANA. These are the well-known ports. Registered ports. The ports ranging from 1024 to 49,151 are not assigned or controlled by lANA. Dynamic ports. The ports ranging from 49,152 to 65,535 are neither controlled nor registered. They can be used by any process. These are the ephemeral ports

24 Figure Port numbers

25 Figure 23.3 IP addresses versus port numbers

26 Figure IANA ranges

27 Figure Socket address

28 Figure 23.6 Multiplexing and demultiplexing

29 Figure Error control

30 Figure 23.8 Position of UDP, TCP, and SCTP in TCP/IP suite

31 PROCESS-TO-PROCESS DELIVERY
The transport layer is responsible for process-to-process delivery—the delivery of a packet, part of a message, from one process to another. Two processes communicate in a client/server relationship, as we will see later.

32 The transport layer is responsible for process-to-process delivery.
Note The transport layer is responsible for process-to-process delivery.

33 Figure 23.1 Types of data deliveries

34 Client, server 1. Local host 2. Local process 3. Remote host 4. Remote process

35 lANA Ranges The lANA (Internet Assigned Number Authority) has divided the port numbers into three ranges: well known, registered, and dynamic (or private) o Well-known ports. The ports ranging from 0 to 1023 are assigned and controlled by lANA. These are the well-known ports. Registered ports. The ports ranging from 1024 to 49,151 are not assigned or controlled by lANA. Dynamic ports. The ports ranging from 49,152 to 65,535 are neither controlled nor registered. They can be used by any process. These are the ephemeral ports

36 Figure Port numbers

37 Figure 23.3 IP addresses versus port numbers

38 Figure IANA ranges

39 Figure Socket address

40 Figure 23.6 Multiplexing and demultiplexing

41 Figure Error control

42 Figure 23.8 Position of UDP, TCP, and SCTP in TCP/IP suite

43 USER DATAGRAM PROTOCOL (UDP)
The User Datagram Protocol (UDP) is called a connectionless, unreliable transport protocol. It does not add anything to the services of IP except to provide process-to-process communication instead of host-to-host communication.

44 13 daytime 111 RPC 161 SNMP 53 DNS

45 Example 23.1 In UNIX, the well-known ports are stored in a file called /etc/services. Each line in this file gives the name of the server and the well-known port number. We can use the grep utility to extract the line corresponding to the desired application. The following shows the port for FTP. Note that FTP can use port 21 with either UDP or TCP.

46 Example 23.1 (continued) SNMP uses two port numbers (161 and 162), each for a different purpose, as we will see in Chapter 28.

47 Figure 23.9 User datagram format

48 UDP length = IP length – IP header’s length
Note UDP length = IP length – IP header’s length

49 Figure 23.10 Pseudoheader for checksum calculation

50 Example 23.2 Figure shows the checksum calculation for a very small user datagram with only 7 bytes of data. Because the number of bytes of data is odd, padding is added for checksum calculation. The pseudoheader as well as the padding will be dropped when the user datagram is delivered to IP.

51 Figure 23.11 Checksum calculation of a simple UDP user datagram

52 UDP Operation Connectionless service- no relation between datagram, not numbered No Flow and error control- no flow control so no window mechanics. No error control except checksum (silently discard packet) Encapsulation and decapsulation-

53 Example A client has a packet of bytes, can this packet be transferred by a single UDP datagram?

54 Example 23.2.3 A UDP header in hexadecimal format
D 00 1C E2 17 What is the source port number? What is the destination port number? What is the total length of the user datagram? What is the length of the data?

55 Incoming and outgoing queue
It will obtain only one port number Port unreachable icmp message (if queue is not created)

56 Figure Queues in UDP

57 Uses of UDP Suitable for process that require simple request response communication with little concern for flow and error control. Suitable for multicasting Used for management process such as SNMP Used for routing updating protocol : RIP

58 Topics discussed in this section:
TCP TCP is a connection-oriented protocol; it creates a virtual connection between two TCPs to send data. In addition, TCP uses flow and error control mechanisms at the transport level. Topics discussed in this section: TCP Services TCP Features Segment A TCP Connection Flow Control Error Control

59 Figure 23.13 Stream delivery

60 Figure 23.14 Sending and receiving buffers

61 Figure TCP segments

62 TCP Numbering system Connection oriented phase- Reliable Features
No segment no – use byte no – sequence no, ack no 0- 2^32 -1 Flow control Error control Congestion control

63 The numbering starts with a randomly generated number.
Note The bytes of data being transferred in each connection are numbered by TCP. The numbering starts with a randomly generated number.

64 Example 23.3 The following shows the sequence number for each segment:

65 The value in the sequence number field of a segment defines the
Note The value in the sequence number field of a segment defines the number of the first data byte contained in that segment.

66 The value of the acknowledgment field in a segment defines
Note The value of the acknowledgment field in a segment defines the number of the next byte a party expects to receive. The acknowledgment number is cumulative.

67 Figure 23.16 TCP segment format

68 Figure Control field

69 Table 23.3 Description of flags in the control field

70 Example The following is a dump of a TCP header in hexadecimal format FF What is the source port number? What is the destination port number? What is sequence number? What is the acknowledgment number? What is the length of the header? What is the type of the segment? What is the window size?

71 Example To make the initial sequence number a random number, most systems start the counter at 1 and increase the counter by every 0.5s, how long does it take for the counter to wrap around?

72 Figure 23.18 Connection establishment using three-way handshaking

73 Syn flooding attack Simultaneous open

74 A SYN segment cannot carry data, but it consumes one sequence number.
Note A SYN segment cannot carry data, but it consumes one sequence number.

75 Note A SYN + ACK segment cannot carry data, but does consume one sequence number.

76 An ACK segment, if carrying no data, consumes no sequence number.
Note An ACK segment, if carrying no data, consumes no sequence number.

77 Figure Data transfer

78 Figure 23.20 Connection termination using three-way handshaking

79 Note The FIN segment consumes one sequence number if it does not carry data.

80 Note The FIN + ACK segment consumes one sequence number if it does not carry data.

81 Figure Half-close


Download ppt "TCP Transport layer Er. Vikram Dhiman LPU."

Similar presentations


Ads by Google