tcp/ip training basic concepts

146
TCP/IP Protocol Suite 1 TCP/IP Protocol Suite پروتكلهاي معرفيTCP/IP نده ده ارائه پناهي اميرحسين خرداد1391 م خدا بنا

Upload: amir-panahi

Post on 19-Feb-2017

414 views

Category:

Internet


2 download

TRANSCRIPT

Page 1: TCP/IP Training Basic Concepts

TCP/IP Protocol Suite 1

TCP/IP Protocol Suite

معرفي پروتكلهاي TCP/IP

ارائه دهندهاميرحسين پناهي

1391خرداد

بنام خدا

Page 2: TCP/IP Training Basic Concepts

TCP/IP Protocol Suite 2

The OSI Model

Established in 1947, the International Standards Organization (ISO) is

a multinational body dedicated to worldwide agreement on

international standards. An ISO standard that covers all aspects of

network communications is the Open Systems Interconnection (OSI)

model. It was first introduced in the late 1970s.

The topics discussed in this section include:

Layered Architecture

Peer-to-Peer Processes

Encapsulation

Page 3: TCP/IP Training Basic Concepts

TCP/IP Protocol Suite 3

ISO is the organization.

OSI is the model

Note:

Page 4: TCP/IP Training Basic Concepts

TCP/IP Protocol Suite 4

The OSI model

Page 5: TCP/IP Training Basic Concepts

TCP/IP Protocol Suite 5

OSI layers

Page 6: TCP/IP Training Basic Concepts

TCP/IP Protocol Suite 6

An exchange using the OSI model

Page 7: TCP/IP Training Basic Concepts

TCP/IP Protocol Suite 7

Layers in the OSI Model

The functions of each layer in the OSI model is briefly described.

The topics discussed in this section include:

Physical Layer

Data Link LayerNetwork LayerTransport LayerSession Layer

Presentation LayerApplication LayerSummary of Layers

Page 8: TCP/IP Training Basic Concepts

TCP/IP Protocol Suite 8

The physical layer is responsible for Movement of individual bits from

one hop (node) to the next.

•Includes electrical and mechanical connection features

•Determines bit rates

•Should be synchronized in transmission clock

•Transmission modes: Simplex, Half and Full duplex

Note:

Physical layer

Page 9: TCP/IP Training Basic Concepts

TCP/IP Protocol Suite 9TCP/IP Protocol Suite 9

The data link layer is responsible for moving frames from one hop (node) to the next

•Framing

•Physical addressing

•Flow control

•Bit error control

•Access control in shared link(CSMA/CD/CA)

Note:

Data link layer

Page 10: TCP/IP Training Basic Concepts

TCP/IP Protocol Suite 10

CSMA/CA

Page 11: TCP/IP Training Basic Concepts

TCP/IP Protocol Suite 11

Hop-to-hop delivery

Page 12: TCP/IP Training Basic Concepts

TCP/IP Protocol Suite 12

The network layer is responsible for the delivery of individual

packets from the source host to the destination host.

•Physical addressing

•Routing

Network layer

Note:

Page 13: TCP/IP Training Basic Concepts

TCP/IP Protocol Suite 13

Source-to-destination delivery

Page 14: TCP/IP Training Basic Concepts

TCP/IP Protocol Suite 14

The transport layer is responsible for the delivery of a message from one process to

another.

•Port addressing (Process Addressing)

•Segmentation and Reassembly by sequencing

•Connection control (connection-less/connection-oriented)

• flow control (window size)

•Error control (Acknowledgement)

Note:

Transport layer

Page 15: TCP/IP Training Basic Concepts

TCP/IP Protocol Suite 15

The Session layer is responsible for synchronization of a message

•Synchronization point insertion and deletion for integrity

validation of message

•Dialog control by changing mode of transmission (half/full duplex)

Note:

Session layer

Page 16: TCP/IP Training Basic Concepts

TCP/IP Protocol Suite 16

The presentation layer is responsible for:

•Translation (coding/decoding)

•Encryption/Decryption

•Compression/Decompression

Note:

Presentation layer

Page 17: TCP/IP Training Basic Concepts

TCP/IP Protocol Suite 17

Application layer

Page 18: TCP/IP Training Basic Concepts

TCP/IP Protocol Suite 18

Summary of layers

Page 19: TCP/IP Training Basic Concepts

TCP/IP Protocol Suite 19

TCP/IP Protocol Suite

The TCP/IP protocol suite is made of five layers: physical, data link,

network, transport, and application. The first four layers provide

physical standards, network interface, internetworking, and transport

functions that correspond to the first four layers of the OSI model. The

three topmost layers in the OSI model, however, are represented in

TCP/IP by a single layer called the application layer.

The topics discussed in this section include:

Physical and Data Link Layers

Network Layer

Transport Layer

Application Layer

Page 20: TCP/IP Training Basic Concepts

TCP/IP Protocol Suite 20

TCP/IP and OSI model

Page 21: TCP/IP Training Basic Concepts

TCP/IP Protocol Suite 21

Addressing

Three different levels of addresses are used in an internet using the

TCP/IP protocols: physical (link) address, logical (IP) address, and

port address.

The topics discussed in this section include:

Physical Address

Logical Address

Port Address

Page 22: TCP/IP Training Basic Concepts

TCP/IP Protocol Suite 22

Relationship of layers and addresses in TCP/IP

Page 23: TCP/IP Training Basic Concepts

TCP/IP Protocol Suite 23

Physical addresses

In Figure a node with physical address 10 sends a frame to a node with physical

address 87. The two nodes are connected by a link. At the data link level this

frame contains physical (link) addresses in the header. These are the only

addresses needed. The rest of the header contains other information needed at

this level. The trailer usually contains extra bits needed for error detection.

07:01:02:01:2C:4B

A 6-byte (12 hexadecimal digits) physical address.

Page 24: TCP/IP Training Basic Concepts

TCP/IP Protocol Suite 24

IP addresses

•In Figure we want to send data from a node

with network address A and physical

address 10, located on one LAN, to a node

with a network address P and physical

address 95, located on another LAN.

Because the two devices are located on

different networks, we cannot use link

addresses only; the link addresses have only

local jurisdiction. What we need here are

universal addresses that can pass through

the LAN boundaries. The network (logical)

addresses have this characteristic.

•The packet at the network layer contains

the logical addresses, which remain the

same from the original source to the final

destination (A and P, respectively, in the

figure). They will not change when we go

from network to network. However, the

physical addresses will change as the packet

moves from one network to another. The

boxes labeled routers are internetworking

devices.

132.24.75.9

An internet address in IPv4 in decimal

numbers

Page 25: TCP/IP Training Basic Concepts

TCP/IP Protocol Suite 25

Figure 2.20 Port addresses

753

A 16-bit port address represented

as one single number.

Page 26: TCP/IP Training Basic Concepts

TCP/IP Protocol Suite 26

•Figure shows an example of transport layer communication. Data

coming from the upper layers have port addresses j and k ( j is the

address of the sending process, and k is the address of the receiving

process). Since the data size is larger than the network layer can handle,

the data are split into two packets, each packet retaining the service-point

addresses ( j and k). Then in the network layer, network addresses (A and

P) are added to each packet.

•The packets can travel on different paths and arrive at the destination

either in order or out of order. The two packets are delivered to the

destination transport layer, which is responsible for removing the

network layer headers and combining the two pieces of data for delivery

to the upper layers

Port addresses

Page 27: TCP/IP Training Basic Concepts

TCP/IP Protocol Suite 27

IP Versions

IP became the official protocol for the Internet in 1983. As the Internet

has evolved, so has IP. There have been six versions since its inception.

We look at the latter three versions here.

The topics discussed in this section include:

Version 4

Version 5

Version 6

Page 28: TCP/IP Training Basic Concepts

TCP/IP Protocol Suite 28

Connecting Devices

LANs or WANs do not normally operate in isolation. They are

connected to one another or to the Internet. To connect LANs or

WANs, we use connecting devices. Connecting devices can operate in

different layers of the Internet model. We discuss three kinds of

connecting devices: repeaters (or hubs), bridges (or two-layer

switches), and routers (or three-layer switches). Repeaters and hubs

operate in the first layer of the Internet model. Bridges and two-layer

switches operate in the first two layers. Routers and three-layer

switches operate in the first three layers

The topics discussed in this section include:

Repeaters

Hubs

Bridges

Router

Page 29: TCP/IP Training Basic Concepts

TCP/IP Protocol Suite 29

Figure 3.28 Connecting devices

Page 30: TCP/IP Training Basic Concepts

TCP/IP Protocol Suite 30

Figure 3.29 Repeater

Page 31: TCP/IP Training Basic Concepts

TCP/IP Protocol Suite 31

A repeater connects segments of a LAN.

Notes:

A repeater forwards every bit;

it has no filtering capability.

A repeater is a regenerator, not an amplifier.

Page 32: TCP/IP Training Basic Concepts

TCP/IP Protocol Suite 32

Figure 3.30 Function of a repeater

Page 33: TCP/IP Training Basic Concepts

TCP/IP Protocol Suite 33

A bridge has a table used in filtering

decisions.

Note:

Page 34: TCP/IP Training Basic Concepts

TCP/IP Protocol Suite 34

Figure 3.31 Bridge

Page 35: TCP/IP Training Basic Concepts

TCP/IP Protocol Suite 35

A bridge does not change the physical

(MAC) addresses in a frame.

Note:

Page 36: TCP/IP Training Basic Concepts

TCP/IP Protocol Suite 36

Figure 3.32 Learning bridge

Page 37: TCP/IP Training Basic Concepts

TCP/IP Protocol Suite 37

A router is a three-layer

(physical, data link, and network)

device.

Note:

Page 38: TCP/IP Training Basic Concepts

TCP/IP Protocol Suite 38

A repeater or a bridge connects segments

of a LAN.

A router connects independent LANs or

WANs to create an internetwork

(internet).

Note:

Page 39: TCP/IP Training Basic Concepts

TCP/IP Protocol Suite 39

Figure 3.33 Routing example

Page 40: TCP/IP Training Basic Concepts

TCP/IP Protocol Suite 40

A router changes the physical addresses

in a packet.

Note:

Page 41: TCP/IP Training Basic Concepts

TCP/IP Protocol Suite 41

CLASSFUL ADDRESSING

IP addresses, when started a few decades ago, used the concept of

classes. This architecture is called classful addressing. In the mid-

1990s, a new architecture, called classless addressing, was introduced

and will eventually supersede the original architecture. However, part

of the Internet is still using classful addressing, but the migration is

very fast.

Page 42: TCP/IP Training Basic Concepts

TCP/IP Protocol Suite 42

Finding the class in binary notation

Page 43: TCP/IP Training Basic Concepts

TCP/IP Protocol Suite 43

Finding the class in decimal notation

Page 44: TCP/IP Training Basic Concepts

TCP/IP Protocol Suite 44

Netid and hostid

Page 45: TCP/IP Training Basic Concepts

TCP/IP Protocol Suite 45

Masking concept

Default masks

Page 46: TCP/IP Training Basic Concepts

TCP/IP Protocol Suite 46

The network address is the beginning

address of each block. It can be found

by applying the default mask to any

of the addresses in the block

(including itself). It retains the netid

of the block and sets the hostid to

zero.

Note:

Page 47: TCP/IP Training Basic Concepts

TCP/IP Protocol Suite 47

Upon completion you will be able to:

ARP and RARP

• Understand the need for ARP

• Understand the cases in which ARP is used

• Understand the components and interactions in an ARP

package

• Understand the need for RARP

Objectives

Page 48: TCP/IP Training Basic Concepts

TCP/IP Protocol Suite 48

ARP and RARP - Position in TCP/IP protocol suite

Page 49: TCP/IP Training Basic Concepts

TCP/IP Protocol Suite 49

ARP

ARP associates an IP address with its physical address. On a typical physical network,

such as a LAN, each device on a link is identified by a physical or station address that is

usually imprinted on the NIC.

Page 50: TCP/IP Training Basic Concepts

TCP/IP Protocol Suite 50

ARP packet / Encapsulation of ARP

Page 51: TCP/IP Training Basic Concepts

TCP/IP Protocol Suite 51

Four cases using ARP

Page 52: TCP/IP Training Basic Concepts

TCP/IP Protocol Suite 52

An ARP request is broadcast;

an ARP reply is unicast.

Note:

Page 53: TCP/IP Training Basic Concepts

TCP/IP Protocol Suite 53

ARP Request/Reply packet Example

Page 54: TCP/IP Training Basic Concepts

TCP/IP Protocol Suite 54

Proxy ARP

Page 55: TCP/IP Training Basic Concepts

TCP/IP Protocol Suite 55

RARP

RARP finds the logical address for a machine that only knows its

physical address.

Page 56: TCP/IP Training Basic Concepts

TCP/IP Protocol Suite 56

The RARP request packets are

broadcast;

the RARP reply packets are unicast.

Note:

Page 57: TCP/IP Training Basic Concepts

TCP/IP Protocol Suite 57

RARP packet / Encapsulation of RARP packet

Page 58: TCP/IP Training Basic Concepts

TCP/IP Protocol Suite 58

Upon completion you will be able to:

Internet Protocol

• Understand the format and fields of a datagram

• Understand the need for fragmentation and the fields involved

• Understand the options available in an IP datagram

• Be able to perform a checksum calculation

• Understand the components and interactions of an IP package

Objectives

Page 59: TCP/IP Training Basic Concepts

TCP/IP Protocol Suite 59

Position of IP in TCP/IP protocol suite

Page 60: TCP/IP Training Basic Concepts

TCP/IP Protocol Suite 60

DATAGRAM

A packet in the IP layer is called a datagram, a variable-length packet consisting of

two parts: header and data. The header is 20 to 60 bytes in length and contains

information essential to routing and delivery.

Page 61: TCP/IP Training Basic Concepts

TCP/IP Protocol Suite 61

Service type or differentiated services

The precedence subfield was designed, but

never used in version 4.

Types of service

Page 62: TCP/IP Training Basic Concepts

TCP/IP Protocol Suite 62

Default types of service

Page 63: TCP/IP Training Basic Concepts

TCP/IP Protocol Suite 63

The total length field defines the total

length of the datagram including the

header.

Note:

Page 64: TCP/IP Training Basic Concepts

TCP/IP Protocol Suite 64

Figure 8.4 Encapsulation of a small datagram in an Ethernet frame

Page 65: TCP/IP Training Basic Concepts

TCP/IP Protocol Suite 65

Protocols field

Page 66: TCP/IP Training Basic Concepts

TCP/IP Protocol Suite 66

TTL field

•This filed is used to make limitation of movement of a packet in the

internet•After any hop in a router this filed is decremented one.•If TTL equals zero, the packet will be discarded.

Page 67: TCP/IP Training Basic Concepts

TCP/IP Protocol Suite 67

FRAGMENTATION

The format and size of a frame depend on the protocol used by the

physical network. A datagram may have to be fragmented to fit theprotocol regulations.

Page 68: TCP/IP Training Basic Concepts

TCP/IP Protocol Suite 68

Flags field

Page 69: TCP/IP Training Basic Concepts

TCP/IP Protocol Suite 69

Detailed fragmentation example

Page 70: TCP/IP Training Basic Concepts

TCP/IP Protocol Suite 70

CHECKSUM

The error detection method used by most TCP/IP protocols is called

the checksum. The checksum protects against the corruption that may

occur during the transmission of a packet. It is redundant information

added to the packet.

The topics discussed in this section include:

Checksum Calculation at the Sender

Checksum Calculation at the Receiver

Checksum in the IP Packet

Page 71: TCP/IP Training Basic Concepts

TCP/IP Protocol Suite 71

To create the checksum the sender does the following:

❏ The packet is divided into k sections, each of n bits.

❏ All sections are added together using 1’s complement

arithmetic.

❏ The final result is complemented to make the

checksum.

Note:

Page 72: TCP/IP Training Basic Concepts

TCP/IP Protocol Suite 72

Figure 8.22 Checksum concept

Page 73: TCP/IP Training Basic Concepts

TCP/IP Protocol Suite 73

Figure 8.23 Checksum in one’s complement arithmetic

Page 74: TCP/IP Training Basic Concepts

TCP/IP Protocol Suite 74

Upon completion you will be able to:

User Datagram

Protocol

• Be able to explain process-to-process communication

• Know the format of a UDP user datagram

• Be able to calculate a UDP checksum

• Understand the operation of UDP

• Know when it is appropriate to use UDP

• Understand the modules in a UDP package

Objectives

Page 75: TCP/IP Training Basic Concepts

TCP/IP Protocol Suite 75

Figure 11.1 Position of UDP in the TCP/IP protocol suite

Page 76: TCP/IP Training Basic Concepts

TCP/IP Protocol Suite 76

11.1 PROCESS-TO-PROCESS

COMMUNICATION

Before we examine UDP, we must first understand host-to-host

communication and process-to-process communication and the

difference between them.

The topics discussed in this section include:

Port Numbers

Socket Addresses

Page 77: TCP/IP Training Basic Concepts

TCP/IP Protocol Suite 77

Figure 11.2 UDP versus IP

Page 78: TCP/IP Training Basic Concepts

TCP/IP Protocol Suite 78

Figure 11.3 Port numbers

Page 79: TCP/IP Training Basic Concepts

TCP/IP Protocol Suite 79

Figure 11.4 IP addresses versus port numbers

Page 80: TCP/IP Training Basic Concepts

TCP/IP Protocol Suite 80

Figure 11.5 ICANN ranges

Page 81: TCP/IP Training Basic Concepts

TCP/IP Protocol Suite 81

The well-known port numbers are

less than 1024.

Note:

Page 82: TCP/IP Training Basic Concepts

TCP/IP Protocol Suite 82

Table 11.1 Well-known ports used with UDP

Page 83: TCP/IP Training Basic Concepts

TCP/IP Protocol Suite 83

Socket address

Page 84: TCP/IP Training Basic Concepts

TCP/IP Protocol Suite 84

USER DATAGRAM

UDP packets are called user datagrams and have a fixed-size header of

8 bytes.

Page 85: TCP/IP Training Basic Concepts

TCP/IP Protocol Suite 85

UDP length =

IP length − IP header’s length

Note:

Page 86: TCP/IP Training Basic Concepts

TCP/IP Protocol Suite 86

11.3 CHECKSUM

UDP checksum calculation is different from the one for IP and ICMP.

Here the checksum includes three sections: a pseudoheader, the UDP

header, and the data coming from the application layer.

The topics discussed in this section include:

Checksum Calculation at Sender

Checksum Calculation at Receiver

Optional Use of the Checksum

Page 87: TCP/IP Training Basic Concepts

TCP/IP Protocol Suite 87

Figure 11.8 Pseudoheader for checksum calculation

Page 88: TCP/IP Training Basic Concepts

TCP/IP Protocol Suite 88

Figure 11.9 Checksum calculation of a simple UDP user datagram

Page 89: TCP/IP Training Basic Concepts

TCP/IP Protocol Suite 89

UDP OPERATION

UDP uses concepts common to the transport layer. These concepts will

be discussed here briefly, and then expanded in the next chapter on the

TCP protocol.

The topics discussed in this section include:

Connectionless Services

Flow and Error Control

Encapsulation and Decapsulation

Queuing

Multiplexing and Demultiplexing

Page 90: TCP/IP Training Basic Concepts

TCP/IP Protocol Suite 90

Figure 11.10 Encapsulation and decapsulation

Page 91: TCP/IP Training Basic Concepts

TCP/IP Protocol Suite 91

Figure 11.11 Queues in UDP

Page 92: TCP/IP Training Basic Concepts

TCP/IP Protocol Suite 92

Figure 11.12 Multiplexing and demultiplexing

Page 93: TCP/IP Training Basic Concepts

TCP/IP Protocol Suite 93

Upon completion you will be able to:

Transmission

Control Protocol

• Be able to name and understand the services offered by TCP

• Understand TCP’s flow and error control and congestion control

• Be familiar with the fields in a TCP segment

• Understand the phases in a connection-oriented connection

• Understand the TCP transition state diagram

• Be able to name and understand the timers used in TCP

• Be familiar with the TCP options

Objectives

Page 94: TCP/IP Training Basic Concepts

TCP/IP Protocol Suite 94

TCP/IP protocol suite

Page 95: TCP/IP Training Basic Concepts

TCP/IP Protocol Suite 95

12.1 TCP SERVICES

We explain the services offered by TCP to the processes at the

application layer.

The topics discussed in this section include:

Process-to-Process Communication

Stream Delivery Service

Full-Duplex Communication

Connection-Oriented Service

Reliable Service

Page 96: TCP/IP Training Basic Concepts

TCP/IP Protocol Suite 96

well-known ports used by TCP

Page 97: TCP/IP Training Basic Concepts

TCP/IP Protocol Suite 97

Stream delivery

Page 98: TCP/IP Training Basic Concepts

TCP/IP Protocol Suite 98

Sending and receiving buffers

Page 99: TCP/IP Training Basic Concepts

TCP/IP Protocol Suite 99

TCP segments

Page 100: TCP/IP Training Basic Concepts

TCP/IP Protocol Suite 100

TCP FEATURES

To provide the services mentioned in the previous section, TCP has

several features that are briefly summarized in this section.

The topics discussed in this section include:

Numbering System

Flow Control

Error Control

Congestion Control

Page 101: TCP/IP Training Basic Concepts

TCP/IP Protocol Suite 101

The bytes of data being transferred in

each connection are numbered by TCP.

The numbering starts with a randomly

generated number.

Note:

Page 102: TCP/IP Training Basic Concepts

TCP/IP Protocol Suite 102

The value in the sequence number

field of a segment defines the number

of the first data byte contained

in that segment.

Note:

Page 103: TCP/IP Training Basic Concepts

TCP/IP Protocol Suite 103

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.

Note:

Page 104: TCP/IP Training Basic Concepts

TCP/IP Protocol Suite 104

SEGMENT

A packet in TCP is called a segment

The topics discussed in this section include:

Format

Encapsulation

Page 105: TCP/IP Training Basic Concepts

TCP/IP Protocol Suite 105

TCP segment format

Page 106: TCP/IP Training Basic Concepts

TCP/IP Protocol Suite 106

Control field

Page 107: TCP/IP Training Basic Concepts

TCP/IP Protocol Suite 107

Figure 12.7 Pseudoheader added to the TCP datagram

Page 108: TCP/IP Training Basic Concepts

TCP/IP Protocol Suite 108

The inclusion of the checksum in

TCP is mandatory.

Note:

Page 109: TCP/IP Training Basic Concepts

TCP/IP Protocol Suite 109

Encapsulation and decapsulation

Page 110: TCP/IP Training Basic Concepts

TCP/IP Protocol Suite 110

A TCP CONNECTION

TCP is connection-oriented. A connection-oriented transport protocol

establishes a virtual path between the source and destination. All of the

segments belonging to a message are then sent over this virtual path. A

connection-oriented transmission requires three phases: connection

establishment, data transfer, and connection termination.

The topics discussed in this section include:

Connection Establishment

Data Transfer

Connection Termination

Connection Reset

Page 111: TCP/IP Training Basic Concepts

TCP/IP Protocol Suite 111

Connection establishment using three-way handshaking

Page 112: TCP/IP Training Basic Concepts

TCP/IP Protocol Suite 112

A SYN segment cannot carry data,

but it consumes one sequence

number.

Note:

Page 113: TCP/IP Training Basic Concepts

TCP/IP Protocol Suite 113

A SYN + ACK segment cannot carry

data, but does consume one

sequence number.

Note:

Page 114: TCP/IP Training Basic Concepts

TCP/IP Protocol Suite 114

An ACK segment, if carrying no

data, consumes no sequence number.

Note:

Page 115: TCP/IP Training Basic Concepts

TCP/IP Protocol Suite 115

Data transfer

Page 116: TCP/IP Training Basic Concepts

TCP/IP Protocol Suite 116

The FIN segment consumes one

sequence number if it does not carry

data.

Note:

Page 117: TCP/IP Training Basic Concepts

TCP/IP Protocol Suite 117

Connection termination using three-way handshaking

Page 118: TCP/IP Training Basic Concepts

TCP/IP Protocol Suite 118

The FIN + ACK segment consumes

one sequence number if it does not

carry data.

Note:

Page 119: TCP/IP Training Basic Concepts

TCP/IP Protocol Suite 119

Half-close

Page 120: TCP/IP Training Basic Concepts

TCP/IP Protocol Suite 120

STATE TRANSITION DIAGRAM

To keep track of all the different events happening during connection

establishment, connection termination, and data transfer, the TCP

software is implemented as a finite state machine. .

The topics discussed in this section include:

Scenarios

Page 121: TCP/IP Training Basic Concepts

TCP/IP Protocol Suite 121

Table 12.3 States for TCP

Page 122: TCP/IP Training Basic Concepts

TCP/IP Protocol Suite 122

State transition diagram

Page 123: TCP/IP Training Basic Concepts

TCP/IP Protocol Suite 123

Common scenario

Page 124: TCP/IP Training Basic Concepts

TCP/IP Protocol Suite 124

Three-way handshake

Page 125: TCP/IP Training Basic Concepts

TCP/IP Protocol Suite 125

Simultaneous open

Page 126: TCP/IP Training Basic Concepts

TCP/IP Protocol Suite 126

Simultaneous close

Page 127: TCP/IP Training Basic Concepts

TCP/IP Protocol Suite 127

Denying a connection

Page 128: TCP/IP Training Basic Concepts

TCP/IP Protocol Suite 128

Aborting a connection

Page 129: TCP/IP Training Basic Concepts

TCP/IP Protocol Suite 129

FLOW CONTROL

Flow control regulates the amount of data a source can send before

receiving an acknowledgment from the destination. TCP defines a

window that is imposed on the buffer of data delivered from the

application program.

The topics discussed in this section include:

Sliding Window Protocol

Silly Window Syndrome

Page 130: TCP/IP Training Basic Concepts

TCP/IP Protocol Suite 130

Sliding window

Page 131: TCP/IP Training Basic Concepts

TCP/IP Protocol Suite 131

A sliding window is used to make

transmission more efficient as well as

to control the flow of data so that the

destination does not become

overwhelmed with data.

TCP’s sliding windows are byte

oriented.

Note:

Page 132: TCP/IP Training Basic Concepts

TCP/IP Protocol Suite 132

Example 5

Page 133: TCP/IP Training Basic Concepts

TCP/IP Protocol Suite 134

Example 7

Page 134: TCP/IP Training Basic Concepts

TCP/IP Protocol Suite 137

ERROR CONTROL

TCP provides reliability using error control, which detects corrupted,

lost, out-of-order, and duplicated segments. Error control in TCP is

achieved through the use of the checksum, acknowledgment, and time-

out.

The topics discussed in this section include:

Checksum

Acknowledgment

Acknowledgment Type

Retransmission

Out-of-Order Segments

Some Scenarios

Page 135: TCP/IP Training Basic Concepts

TCP/IP Protocol Suite 138

ACK segments do not consume

sequence numbers and are not

acknowledged.

Note:

Page 136: TCP/IP Training Basic Concepts

TCP/IP Protocol Suite 139

In modern implementations, a

retransmission occurs if the

retransmission timer expires or three

duplicate ACK segments have arrived.

Note:

Page 137: TCP/IP Training Basic Concepts

TCP/IP Protocol Suite 140

No retransmission timer is set for an

ACK segment.

Note:

Page 138: TCP/IP Training Basic Concepts

TCP/IP Protocol Suite 141

Data may arrive out of order and be

temporarily stored by the receiving TCP,

but TCP guarantees that no out-of-order

segment is delivered to the process.

Note:

Page 139: TCP/IP Training Basic Concepts

TCP/IP Protocol Suite 142

Normal operation

Page 140: TCP/IP Training Basic Concepts

TCP/IP Protocol Suite 143

Lost segment

Page 141: TCP/IP Training Basic Concepts

TCP/IP Protocol Suite 144

The receiver TCP delivers only

ordered data to the process.

Note:

Page 142: TCP/IP Training Basic Concepts

TCP/IP Protocol Suite 145

Fast retransmission

Page 143: TCP/IP Training Basic Concepts

TCP/IP Protocol Suite 146

Lost acknowledgment

Page 144: TCP/IP Training Basic Concepts

TCP/IP Protocol Suite 147

Lost acknowledgment corrected by resending a segment

Page 145: TCP/IP Training Basic Concepts

TCP/IP Protocol Suite 148

Lost acknowledgments may create

deadlock if they are not properly

handled.

Note:

Page 146: TCP/IP Training Basic Concepts

TCP/IP Protocol Suite 149

با تشكر؟