Você está na página 1de 65

Please purchase a personal license.

CCNA Exploration version 4.0

Objectives

Explain the role of Transport Layer protocols and services in supporting communications across data networks Analyze the application and operation of TCP mechanisms that support reliability Analyze the application and operation of TCP mechanisms that support reassembly and manage data loss. Analyze the operation of UDP to support communicate between two processes on end devices

H c vi n m ng Bch Khoa - Website: www.bkacad.com

Application data

IP Protocol Field = 17

Application data

IP Protocol Field = 6

H c vi n m ng Bch Khoa - Website: www.bkacad.com

Extra: Logical Connection

Connectionoriented

Connectionless

Connectionless

H c vi n m ng Bch Khoa - Website: www.bkacad.com

Extra: TCP Operation

IP is best effort delivery. The transport layer (TCP) is responsible reliability and flow control
from source to destination.This is accomplished using:

sliding windows (flow control) sequencing numbers and acknowledgments (reliability) synchronization (establish a virtual circuit)
H c vi n m ng Bch Khoa - Website: www.bkacad.com 5

Roles of Transport Layer

H c vi n m ng Bch Khoa - Website: www.bkacad.com

Transport Layer Role and Services

The purpose of the Transport layer:

1. Enables multiple applications


to communicate over the network at the same time on a single device Ensures that, if required, all the data is received reliably and in order by the correct application Employs error handling mechanisms

2.

3.

H c vi n m ng Bch Khoa - Website: www.bkacad.com

Transport Layer Role and Services

Major functions of the transport layer:


communication between applications on the source and destination hosts Segmenting data and managing each piece Reassembling the segments into streams of application data Identifying the different applications

1. Tracking the individual

2. 3. 4.

H c vi n m ng Bch Khoa - Website: www.bkacad.com

Separating Multiple Communications

Computer connected to a network that is simultaneously receiving and sending e-mail and instant messages, viewing websites, and conducting a VoIP phone call. Each of these applications is sending and receiving data over the network at the same time. However, data from the phone call is not directed to the web browser, and text from an instant message does not appear in an e-mail.

H c vi n m ng Bch Khoa - Website: www.bkacad.com

Extra: Multiplexing

Multiple applications can share the same transport connection in the


OSI reference model. Different applications can send data segments on a first-come, firstserved basis. The segments that arrive first will be taken care of first. This is referred to as the multiplexing of upper-layer conversations.

H c vi n m ng Bch Khoa - Website: www.bkacad.com

10

Segmentation
Without
segmentation, only one application, the streaming video for example, would be able to receive data. You could not receive e-mails, chat on instant messenger, or view web pages while also viewing the video.

H c vi n m ng Bch Khoa - Website: www.bkacad.com

11

Controlling the Conversation


Segmentation and Reassembly Conversation Multiplexing
Transport layer provides: Connection-oriented conversations Reliable delivery Ordered data reconstruction Flow control

H c vi n m ng Bch Khoa - Website: www.bkacad.com

12

Controlling the Conversation

H c vi n m ng Bch Khoa - Website: www.bkacad.com

13

Transport Layer Role and Services

At the Transport layer the 3 basic operations of reliability are:


tracking transmitted data acknowledging received data retransmitting any unacknowledged data
H c vi n m ng Bch Khoa - Website: www.bkacad.com 14

Transport Layer Role and Services

Transmission Control Protocol (TCP) TCP is a connection-oriented protocol, described in RFC 793. TCP incurs additional overhead to gain functions. Additional functions specified by TCP are the same order delivery, reliable delivery, and flow control. Each TCP segment has 20 bytes of overhead in the header encapsulating the Application layer data, whereas each UDP segment only has 8 bytes of overhead

Web, email, file transfer

DNS, Video streaming, VoIP

UDP is a simple, connectionless protocol, described in RFC 768. It has the advantage of providing for low overhead data delivery: besteffort delivery
H c vi n m ng Bch Khoa - Website: www.bkacad.com 15

TCP Header format:

H c vi n m ng Bch Khoa - Website: www.bkacad.com

16

TCP Header format: Port number

Source Port 16 bits. Destination Port 16 bits.

H c vi n m ng Bch Khoa - Website: www.bkacad.com

17

TCP Header format: Sequence

Sequence Number: 32 bits


The sequence number of the first data octet in this segment (except when SYN is present).
H c vi n m ng Bch Khoa - Website: www.bkacad.com 18

TCP Header format: Acknowledgment

Acknowledgment Number: 32 bits


This field contains the value of the next sequence number the sender of the segment is expecting to receive.
H c vi n m ng Bch Khoa - Website: www.bkacad.com 19

TCP Header format: Code bits

Control Bits: 8 bits URG: Urgent pointer field is valid ACK: Acknowledgment field significant PSH: This segment requests a push RST: Reset the connection SYN: Synchronize sequence numbers FIN: No more data from sender
H c vi n m ng Bch Khoa - Website: www.bkacad.com 20

Example: code bits

H c vi n m ng Bch Khoa - Website: www.bkacad.com

21

TCP Header format: Window

Window: 16 bits
The number of data octets beginning with the one indicated in the acknowledgment field which the sender of this segment is willing to accept.
H c vi n m ng Bch Khoa - Website: www.bkacad.com 22

TCP Header format: Window

Urgent Pointer: 16 bits


Points to the firsrt data octet following the urgent data. Only significant when the URG control bit is set.

H c vi n m ng Bch Khoa - Website: www.bkacad.com

23

User Datagram Protocol (UDP)

UDP is a simple protocol that exchanges datagrams, without acknowledgments or guaranteed delivery. Error processing and retransmission must be handled by higher layer protocols UDP is designed for applications that do not need to put sequences of segments together . Each UDP datagram is sent within a single IP datagram. All IP implementations are required to accept datagrams of 576 bytes, which means that, allowing for maximum-size IP header of 60 bytes, a UDP datagram of 516 bytes is acceptable to all implementations. Many implementations will accept larger datagrams, but this is not guaranteed.

H c vi n m ng Bch Khoa - Website: www.bkacad.com

24

UDP header fields



Source port Number of the calling port Destination port Number of the called port Length Number of bytes including header and data Checksum Calculated checksum of the header and data fields Data Upper-layer protocol data The protocols that use UDP include: - TFTP (Trivial File Transfer Protocol) - SNMP (Simple Network Management Protocol) - DHCP (Dynamic Host Control Protocol) - DNS (Domain Name System)

H c vi n m ng Bch Khoa - Website: www.bkacad.com

25

Transport Layer Role and Services

Port number representation and its role

H c vi n m ng Bch Khoa - Website: www.bkacad.com

26

Port and TCP port

Reserved for services and applications. They are commonly used for These port numbers are assigned to user processes or applications.
When not used for a server resource, these ports may also be used dynamically selected by a client as its source port.

applications such as HTTP (web server) POP3/SMTP (e-mail server) and Telnet

These are usually assigned dynamically to client applications when


H c vi n m ng Bch Khoa - Website: www.bkacad.com

initiating a connection. It is not very common for a client to connect to a service using a Dynamic or Private Port
27

UDP port

H c vi n m ng Bch Khoa - Website: www.bkacad.com

28

TCP and UDP Common Port

H c vi n m ng Bch Khoa - Website: www.bkacad.com

29

TCP and UDP port numbers

Both TCP and UDP use port (socket) numbers to pass information
to the upper layers. Port numbers are used to keep track of different conversations crossing the network at the same time.

H c vi n m ng Bch Khoa - Website: www.bkacad.com

30

Extra: Sockets

The socket interface is one of several application programming


interfaces (APIs) to the communication protocols. A socket is a special type of file handle, which is used by a process to request network services from the operating system. A socket address is the triple:

<protocol, local-address, local-process>


For example, in the TCP/IP suite: <tcp, 193.44.234.3, 12345>

H c vi n m ng Bch Khoa - Website: www.bkacad.com

31

Netstat command

H c vi n m ng Bch Khoa - Website: www.bkacad.com

32

Transport Layer Role and Services

Segmentation and Reassembly.

H c vi n m ng Bch Khoa - Website: www.bkacad.com

33

The TCP Protocol Communicating with Reliability

H c vi n m ng Bch Khoa - Website: www.bkacad.com

34

TCP Making Conversations Reliable

The key distinction between TCP and UDP is reliability.

H c vi n m ng Bch Khoa - Website: www.bkacad.com

35

TCP Server Processes

Each application process running on the server is configured to use a port number, either by default or manually by a system administrator.
Request destination port, request source port Response destination port, response source port

H c vi n m ng Bch Khoa - Website: www.bkacad.com

36

3-way handshake

H c vi n m ng Bch Khoa - Website: www.bkacad.com

37

3-way handshake

H c vi n m ng Bch Khoa - Website: www.bkacad.com

38

Application and Operation of TCP Mechanisms

H c vi n m ng Bch Khoa - Website: www.bkacad.com

39

Application and Operation of TCP Mechanisms

H c vi n m ng Bch Khoa - Website: www.bkacad.com

40

Managing TCP Sessions

H c vi n m ng Bch Khoa - Website: www.bkacad.com

41

TCP Segment Reassembly

Resequencing Segments to Order Transmitted

H c vi n m ng Bch Khoa - Website: www.bkacad.com

42

TCP Acknowledgement with Windowing

H c vi n m ng Bch Khoa - Website: www.bkacad.com

43

TCP Retransmission

Retransmission for lost data employed by TCP. If the ACK is not received within a timeout interval, the data is retransmitted.

H c vi n m ng Bch Khoa - Website: www.bkacad.com

44

Managing TCP Sessions

H c vi n m ng Bch Khoa - Website: www.bkacad.com

45

Managing TCP Sessions

H c vi n m ng Bch Khoa - Website: www.bkacad.com

46

Managing TCP Sessions

H c vi n m ng Bch Khoa - Website: www.bkacad.com

47

Managing TCP Sessions

H c vi n m ng Bch Khoa - Website: www.bkacad.com

48

TCP Congestion Control Minimizing Segment Loss

Flow Control

H c vi n m ng Bch Khoa - Website: www.bkacad.com

49

TCP Congestion Control Minimizing Segment Loss

Reducing window size

H c vi n m ng Bch Khoa - Website: www.bkacad.com

50

Extra: Flow Control

Goal:
Flow control avoids the problem of a transmitting host overflowing the buffers in the receiving host. TCP provides the mechanism for flow control by allowing the sending and receiving host to communicate. The two hosts then establish a data-transfer rate that is agreeable to both.
H c vi n m ng Bch Khoa - Website: www.bkacad.com 51

Flow Control

When datagrams arrive too


quickly for a host or gateway to process and the transport function can issue a not ready indicator to the sender to stop sending data. When the receiver can handle additional data, the receiver sends a ready transport indicator. When this indicator is received, the sender can resume the segment transmission.
H c vi n m ng Bch Khoa - Website: www.bkacad.com 52

Windowing and Acknowledgment

The purpose of windowing is to improve flow control and reliability. The window size is determined by the receiver when the connection is established and is variable during the data transfer. Window size refers to the number of bytes that are transmitted before receiving an acknowledgment. The window size determines how much data the receiving station can accept at one time.
H c vi n m ng Bch Khoa - Website: www.bkacad.com 53

Simple Windowing

This is known as a Stop-and-Wait windowing protocol.


H c vi n m ng Bch Khoa - Website: www.bkacad.com 54

Sliding Windows
Initial Window size Usable Window Can send ASAP Working Window size Octets sent Usable Window Not ACKed Can send ASAP ASAP=As Soon As Possible

H c vi n m ng Bch Khoa - Website: www.bkacad.com

55

Host A - Sender
1 2 3 4 5 6 7 8 9 10 11 12 13 1 2 3 4

Host B - Receiver
5 6 7 8 9 10 11 12 13

10

11

12

13

Window size = 6 Octets sent Not ACKed


1 2 3 4 5 6

1 2 3
13

Usable Window Can send ASAP


7 8 9 10 11 12

ACK 4 4 5

10

11

12

13

10

11

12

13 1 2 3 4 5 6 7 8 9 10 11 12 13

10

11

12

13

ACK 6 6 7

1 1

2 2

3 3

4 4

5 5

6 6

7 7

8 8

9 9

10 10

11 11

12 12

13 1 13 2 3 4 5 6 7 8 9 10 11 12 13

8 9
1 2 3 4 5 6 7 8 9 10 11 12 13

H c vi n m ng Bch Khoa - Website: www.bkacad.com

56

The UDP Protocol Communicating with Low overhead

H c vi n m ng Bch Khoa - Website: www.bkacad.com

57

UDP Low overhead vs. Reliability


UDP is a simple protocol that
provides the basic Transport layer functions. It much lower overhead than TCP, since it is not connection-oriented and does not provide the sophisticated retransmission, sequencing, and flow control mechanisms. Domain Name System (DNS) Simple Network Management Protocol (SNMP) Dynamic Host Configuration Protocol (DHCP) Routing Information Protocol (RIP) Trivial File Transfer Protocol (TFTP) Online games
H c vi n m ng Bch Khoa - Website: www.bkacad.com 58

UDP Datagram Reassembly

UDP simply reassembles the data in the order that it was received and forwards it to the application.

H c vi n m ng Bch Khoa - Website: www.bkacad.com

59

UDP Server Processes and Requests

Like TCP-based applications, UDP-based server applications are assigned Well Known or Registered port numbers.

H c vi n m ng Bch Khoa - Website: www.bkacad.com

60

UDP Client Processes

As with TCP, client/server communication is initiated by a client application that is requesting data from a server process: using ports

H c vi n m ng Bch Khoa - Website: www.bkacad.com

Lab 4.2.5.2

61

Extra: Denial of Service (DoS) Attacks


DoS attacks are a common method
that hackers utilize to halt system response. One type of DoS is known as SYN flooding. SYN flooding exploits the normal three-way handshake and causes targeted devices to ACK to source addresses that will not complete the handshake.

C:/> netstat SYN_RECV

H c vi n m ng Bch Khoa - Website: www.bkacad.com

62

Lab: Observing TCP and UDP using Netstat

H c vi n m ng Bch Khoa - Website: www.bkacad.com

63

Summary

H c vi n m ng Bch Khoa - Website: www.bkacad.com

64

H c vi n m ng Bch Khoa - Website: www.bkacad.com

65

Você também pode gostar