Lecture 1.1.4
Lecture 1.1.4
CK
SYN A
ACK
Data
Data
4
Tearing Down the Connection
B
SYN A
FIN A
ACK
ACK
ACK
SYN
FIN
FIN
Data
C
CK
K
A
time
5
User Datagram Protocol (UDP)
Connectionless, unreliable
Alternative to TCP
end-to-end protocol
Not guaranteed delivery
No preservation of sequence
No protection against duplication or packet lost
Minimum overhead
No flow control-receiver may overflow with msgs.
Less complex, simple than TCP, Easy to implement
UDP header consumes less network overhead.
6
Why Would Anyone Use UDP?
• Finer control over what data is sent and when
As soon as an application process writes into the socket
… UDP will package the data and send the packet
• No connection state
No allocation of buffers, parameters, sequence #s, etc.
… making it easier to handle many active clients at once
Usage TCP is suited for applications that require high UDP is suitable for applications that need fast, efficient
reliability, and transmission time is relatively less transmission, such as games. UDP's stateless nature is also useful
critical. for servers that answer small queries from huge numbers of clients.
Use by other HTTP, HTTPs, FTP, SMTP, Telnet DNS, DHCP, TFTP, SNMP, RIP, VOIP.
protocols
Ordering of data TCP rearranges data packets in the order UDP has no inherent order as all packets are independent of each
packets specified. other. If ordering is required, it has to be managed by the
application layer.
Speed of transfer The speed for TCP is slower than UDP. UDP is faster because error recovery is not attempted. It is a "best
effort" protocol.
Reliability There is absolute guarantee that the data There is no guarantee that the messages or packets sent would
transferred remains intact and arrives in the same reach at all.
order in which it was sent.
Header Size TCP header size is 20 bytes UDP Header size is 8 bytes.
8
Common Header Fields Source port, Destination port, Check Sum Source port, Destination port, Check Sum
Streaming of data Data is read as a byte stream, no distinguishing Packets are sent individually and are checked for integrity only
indications are transmitted to signal message (segment) if they arrive. Packets have definite boundaries which are
boundaries. honored upon receipt, meaning a read operation at the receiver
socket will yield an entire message as it was originally sent.
Weight TCP is heavy-weight. TCP requires three packets to set UDP is lightweight. There is no ordering of messages, no
up a socket connection, before any user data can be tracking connections, etc. It is a small transport layer designed
sent. TCP handles reliability and congestion control. on top of IP.
Data Flow Control TCP does Flow Control. TCP requires three packets to UDP does not have an option for flow control
set up a socket connection, before any user data can be
sent. TCP handles reliability and congestion control.
Error Checking TCP does error checking and error recovery. Erroneous UDP does error checking but simply discards erroneous
packets are retransmitted from the source to the packets. Error recovery is not attempted.
destination.
Fields 1. Sequence Number, 2. AcK number, 3. Data offset, 4. 1. Length, 2. Source port, 3. Destination port, 4. Check Sum
Reserved, 5. Control bit, 6. Window, 7. Urgent Pointer
8. Options, 9. Padding, 10. Check Sum, 11. Source port,
12. Destination port
9
Routing Protocols
Interior and Exterior Routing
An internet can be so large that one routing protocol cannot handle the task of updating routing table
of all routers
Interior routing
Exterior routing
12
13
14
IP ROUTING
STATIC ROUTING-MANUAL
DEFAULT ROUTING:
A default route is the route that takes effect when no other route is available for an IP destination
address.
Default Routing Configuration
Routing Table
IP Routing
A host or a router has a router table with an entry for each destination or a combination of
destinations to route IP packets.
Methods for populating a routing table:
21
22
REFERENCES
1. Reference Book: T1: Data Communications and Networking, Behrouz A. Forouzan, 5th Edition,
Tata Mcgraw Hill Publication.
23
THANK YOU
For queries
Email: [email protected]
24