Você está na página 1de 34

TCP

TCP means TRANSMISSION CONTROL


PROTOCOl.
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.

TCP is responsible for breaking data down into


small packets before they can be sent over a
network, and for assembling the packets again
when they arrived to the destination.
TCP FEATURES
1) Numbering System:
Byte Number: The bytes of data being transferred in each
connection are numbered by TCP. The numbering starts
with a randomly generated number.
Sequence Number: The value in the sequence number
field of a segment defines the number of the first data byte
contained in that segment.
Acknowledgment Number: The value of the
acknowledgment field in a segment defines the number of
the next byte a party expects to receive.
2) TCP provides flow control
The receiver of the data controls the amount of data that are
to be sent by the sender. This is done to prevent the receiver
from being overwhelmed with data.
TCP uses byte-oriented flow control.
• 3) Error Control:
• To provide reliable service, TCP implements an error control
mechanism.
• Error control considers a segment as the unit of data for error detection
(loss or corrupted loss or corrupted segments).

TCP Header format:


Source port address. This is a 16-bit field that defines the port
number of the application program in the host that is sending the
segment. This serves the same purpose as the source port address in
the UDP header.
Destination port address. This is a 16-bit field that defines the port
number of the application program in the host that is receiving the
segment. This serves the same purpose as the destination port address
in the UDP header.
Sequence number. This 32-bit field defines the number assigned to
the first byte of data contained in this segment. As we said before,
TCP is a stream transport protocol. To ensure connectivity, each byte
to be transmitted is numbered. The sequence number tells the
destination which byte in this sequence comprises the first byte in the
segment. During connection establishment, each party uses a random
number generator to create an initial sequence number (ISN), which
is usually different in each direction.
Acknowledgment number.
This 32-bit field defines the byte number that the receiver of
the segment is expecting to receive from the other party.
 If the receiver of the segment has successfully received byte
number x from the other party, it defines x + I as the
acknowledgment number.
Acknowledgment and data can be piggybacked together.
Header length. This 4-bit field indicates the number of 4-byte
words in the TCP header.
The length of the header can be between 20 and 60 bytes.
Therefore, the value of this field can be between 5 (5 x 4 =20)
and 15 (15 x 4 =60).
Reserved. This is a 6-bit field reserved for future use.
• Control. This field defines 6 different control bits or flags as
shown in Figure above.
The 6 control flags
URG: urgent pointer is valid
ACK: acknowledgement is valid
PUSH: request for push
FIN: fine termination number
RST: reset the connection
SYN: synchronize the sequesnce number
TCP SERVICES
A). Process-to-Process Communication
• Like UDP, TCP provides process-to-process communication
using port numbers
• Ports used by TCP
B). Stream Delivery Service
• TCP is a stream-oriented protocol.
• The sending process produces the stream of bytes, and the
receiving process consumes them.
C).Full-Duplex Communication:
• TCP offers full-duplex service, in which data can flow in both
directions at the same time. Each TCP then has a sending and
receiving buffer, and segments move in both directions.
D). Connection-Oriented Service
TCP, unlike UDP, is a connection-oriented protocol.
When a process at site A wants to send and receive
data from another process at site B, the following
occurs:
1.The two TCPs establish a connection between them.
2.Data are exchanged in both directions.
3.The connection is terminated.
E) Reliable Service

TCP, unlike UDP, is a connection-oriented


protocol.
 When a process at site A wants to send and
receive data from another process at site B, the
following occurs:
The two TCPs establish a connection between
them.
Data are exchanged in both directions.
The connection is terminated.
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.
UDP Header
Source port number. This is the port number used by
the process running on the source host. It is 16 bits long,
which means that the port number can range from 0 to
65,535.
Destination port number. This is the port number
used by the process running on the destination host.
It is also 16 bits long.
Length. This is a 16-bit field that defines the total length of
the user datagram, header plus data.
 The 16 bits can define a total length of 0 to 65,535 bytes.
This field is used to detect errors over the entire user
datagram.
UDP OPERATION

 Connectionless Services
• There is no relationship between the different user
datagrams even if they are coming from the same source
process and going to the same destination program.
• The user datagrams are not numbered.
• There is no connection establishment and no connection
termination.
• Each user datagram can travel on a different path.
 Flow and Error Control
• UDP is a very simple, unreliable transport protocol.
• No flow control and hence no window mechanism.
• There is no error control mechanism in UDP except
for the checksum.
• Sender does not know if a message has been lost or
duplicated.
• When the receiver detects an error through the
checksum, the user datagram is silently discarded.
 Encapsulation and Decapsulation
• To send a message from one process to another, the UDP
protocol encapsulates and decapsulates messages in an IP
datagram.
USE OF UDP
UDP is suitable for a process that requires simple
request-response communication with little
concern for flow and error control.
UDP is suitable for a process with internal flow
and error control mechanisms.
UDP is a suitable transport protocol for
multicasting. Multicasting capability is embedded
in the UDP software but not in the TCP software.
UDP is used for management processes such as
SNMP.
UDP is used for some route updating protocols
such as Routing Information Protocol (RIP).
IPv6
Provides enhancements over existing IP.
 Designed to accommodate higher speeds
and the mix of graphic and video data.
Driving force was the need for more addresses
due to growth of the Internet.
 IPv6 includes 128-bit source and
destination address fields.
8 sets of 16-bits.
Con’t
IPV6 Header
Con’t.
The flow label is used for prioritized delivery,
such as delivery needed by real-time data (voice
and video.
The size of this field is 20 bits.
The Payload Length field indicates the length
of the IPv6 payload.
The size of this field is 16 bits.
With 16 bits, an IPv6 payload of up to 65,535
bytes can be indicated.
Con’t…
 The Next Header field indicates either the
type of the first extension header (if present) or
the protocol in the upper-layer PDU (such as
TCP, UDP, or ICMPv6).
The size of this field is 8 bits.
The Hop Limit field indicates the maximum
number of links over which the IPv6 packet can
travel before being discarded
The size of this field is 8 bits.
When Hop Limit equals 0 at a router, the router
sends an ICMPv6 Time Exceeded-Hop Limit
Exceeded in Transit message to the source and
discards the packet.
The Source Address field indicates the IPv6
address of the originating host.
 The size of this field is 128 bits.
The Destination Address field indicates the
IPv6 address of the current destination node.
 The size of this field is 128 bits.
INTERNET CONTROL MESSAGE PROTOCOL( ICMP )
TYPES OF MESSAGES OF ICMP
a). error-reporting messages.
• The error-reporting messages report problems
that a router or host(destination)may encounter.
b).Query messages.
• The query messages get specific information
from a router or an other host.
A). Error reporting
• Destination unreachable:
• When the subnet or a router can not locate the destination.
• Time exceeded:
• When a packet is dropped because its counter has reached
zero.
• Parameter problem
• Indicates that an illegal value has been detected in the
header field.
• Source quench
• To throttle hosts that send too many packets, When a host
receives this message, it slows down sending packets.
• Redirect
• Is used when a router notices that a packet seems to be
routed wrong.
• It is used by the router to tell the sending host about the
probable error.
B). Query Messages
• ECHO & ECHO Reply
• To see if a given destination is reachable and
alive, upon receipt of ECHO message, the
• destination is expected to send an ECHO REPLY
message back.
• Time stamp & Time stamp reply
• Similar to ECHO queries, except that the arrival
time of the message and departure time of the
reply are recorded in the reply.
• This facility is used to measure network
performance.
DATA ENCAPSULATION OF ICMP
ICMP functions
1) Announce network errors: Such host or Entire portion of as the
network being unreachable, due to some type of failure.
• A TCP or UDP packet directed at a port number with no receiver
attached is also reported via ICMP.
2) Announce network congestion: When a router begins buffering
too many packets, due to an inability to transmit them as fast as
they are being received, it will generate ICMP Source Quench
messages. Directed at the sender, these messages should cause the
rate of packet transmission to be slowed.
3) Assist Troubleshooting: ICMP supports an Echo function, which
just sends a packet on a round--trip between two hosts.
4) Announce Timeouts: If an IP packet's TTL field drops to zero,
the router discarding the packet will often generate an ICMP
packet announcing this fact.
Conclusion
 The purpose of TCP/IP is to make it easier for computers to
communicate with one another to send information over the
Internet.
 The purpose was to allow computers to communicate over long
distance networks. The TCP part has to do with the verifying delivery
of the packets.
 The IP part refers to the moving of data packets between nodes.
 UDP is connectionless protocol and No session establishment .it is
used for Point-to-point communication and Point-to-multi-point
communication.
 An IPv6 address (header) is 4 times larger than IPv4, but surprisingly,
the header of an IPv6 address is only 2 times larger than that of
IPv4.It is the next generation of IP addresses and 128-bit
hexadecimal address.
 Purpose of ICMP is to provide error control to IP and the Internet
control message protocol (ICMP) has been designed to compensate
for IP protocol deficiencies.

Você também pode gostar