|Home > Computers & Networking > Introduction to TCP/IP > UDP (User Datagram Protocol)|
An Introduction to TCP/IP ...page 4
The User Datagram Protocol (UDP) is a transport layer protocol defined for use with the IP network layer protocol. The service provided by UDP is sometimes referred to as "unreliable" since the protocol provides no guarantees for delivery and no protection from duplication. A UDP is like a post card, where you post the card and assume that it had been delivered. The simplicity of UDP reduces the overhead from using the protocol and the services may be adequate in many cases. A computer may send UDP packets without first establishing a connection with the recipient. The computer completes the appropriate fields in the UDP header and forwards the data together with the header for transmission by the IP network layer.
Source Port: UDP packets from a client use this as a service access point (SAP) to indicate the session on the local client that originated the packet. UDP packets from a server carry the server SAP in this field.
Destination Port: UDP packets from a client use this as a service access point (SAP) to indicate the service required from the remote server. UDP packets from a server carry the client SAP in this field.
UDP length: The number of bytes comprising the combined UDP header information and payload data.
UDP Checksum: A checksum to verify that the end to end data has not been corrupted by routers or bridges in the network or by the processing in an end system. The algorithm to compute the checksum is the Standard Internet Checksum algorithm.
The Transmission Control Protocol, TCP, defines a key service provided by an Internet, namely, reliable stream delivery. TCP provides a full duplex connection between two machines, allowing them to exchange large volumes of data efficiently.
The above figure shows a protocol using positive acknowledgement with retransmission in which the sender awaits an acknowledgement for each packet sent. Vertical distance down the figure represents increasing time and diagonal lines across the middle represent network packet transmission.
The Sliding window makes stream transmission efficient. This protocol uses network bandwidth better because they allow the sender to transmit multiple packets before waiting for an acknowledgement. The protocol places a small, fixed-size window on the sequence and transmits all packets that lie inside the window. The easiest way to envision sliding window operation is to think of a sequence of packets to be transmitted.
The above figure is an example of three packets transmitted using a sliding window protocol. The Key concept is that the sender can transmit all packets in the window without waiting for an acknowledgement.
TCP Segment Format:
The unit of transfer between the TCP software on two machines is called a segment. Segments are exchanged to establish connections, to transfer data, to send acknowledgements, to advertise window sizes, and to close connections. Because TCP uses Piggybacking, n acknowledgement traveling from machine A to machine B, even though the acknowledgement refers to data sent from B to A.
The above figure is the format of a TCP segment with a TCP header followed by data. Segments are used to establish connections as well as to carry data and acknowledgements.
TCP implements flow control by having the receiver advertise the amount of data it is willing to accept. It also supports out-of-band messages using an urgent data facility and forces delivery using a push mechanism.
To ensure that all networks remain reachable with high reliability, an Internet must provide globally consistent routing. Hosts and most routers contain only partial routing information; they depend on default routes to send datagrams to distant destinations. The global Internet solves the routing problem by using a core router architecture in which sets of core routers contain complete information about all networks.
Routing Information Protocol (RIP):
One of the most widely used IGPs (Interior Gateway Protocol) is the Routing Information Protocol (RIP). RIP uses distance-vector protocol to determine the routes. There are two versions of RIP, RIP version 1 and RIP version 2. RIP v1 uses hop-count for determining the distance to reach a destination. Route that has lesser number of hops is preferred to that with more number of hops. The disadvantage of RIP is if you have a 1 Gbps route with two hops, and another with 56Kbps with one hop away, the router prefers the one hop route irrespective of the bandwidth offered. Link state protocols such as Cisco proprietary EIGRP, OSPF, and IS-IS take multiple factors into account when computing optimal route to a destination. However, being one of the earliest routing protocol, RIP is prevalent and explained below.
RIP Message format:
RIP messages can be broadly classified into two types: routing information messages and messages used to request information. Both uses the same format consists of a fixed header followed by an optional list of network and distance pairs. The following figure 12 shows the message format:
In the figure, field COMMAND specifies an operation according to the following table:
Transmitting RIP Messages:
RIP messages do not contain an explicit length field. Instead, RIP assumes that the underlying delivery mechanism will tell the receiver the length of an incoming message. In particular, when used with TCP/IP, RIP messages rely on UDP to tell the receiver the message length. RIP operates on UDP port 520. Although a RIP request can originate at other UDP ports, the destination UDP port for requests is always 520, as is the source port from which RIP broadcast messages originate.
|Home Copyright © 2003-2018 TutorialsWeb.com Disclaimer Sitemap|