Computer Networks (CS F303) : Pilani
Computer Networks (CS F303) : Pilani
• Course Overview
• Course Administration
• What is network?
• What is Internet?
• Network Structure
– Edge, Access Network (Physical Media), Network Core
• Internet Structure
2
Computer Networks CS F303 BITS Pilani, Pilani Campus
Course Objective
4
Computer Networks CS F303 BITS Pilani, Pilani Campus
Course Administration and Text Book(s)
• Instruction delivery
– Lecture classes
• 11:00 – 11:50 AM [T Th F]
– Lab classes
• Starting from 20th Jan 2025
• Course page Information
– NALANDA LMS
• Evaluation Plan
– Mid Semester Test @25%
– Quiz @15% [22 Feb 2025]
– Lab Exam@20% [20 Apr 2025]
– Comprehensive exam @40%
5
Computer Networks CS F303 BITS Pilani, Pilani Campus
What is a Network?
WiFi 8
Computer Networks CS F303 BITS Pilani, Pilani Campus
The Internet: “nuts and bolts” view
mobile network
• Network edge: applications and hosts national or global ISP
11
Computer Networks CS F303 BITS Pilani, Pilani Campus
Access networks: Data Center Networks
mobile network
High-bandwidth links (10s to 100s national or global ISP
Gbps) connect hundreds to thousands
of servers together, and to Internet
local or
regional ISP
13
Computer Networks CS F303 BITS Pilani, Pilani Campus
Physical Media-Unguided
• Radio link types:
– Classified into three groups
• Short distance (a few meters), local areas (10 to a few hundred meters),
wide area (spans in tens of kms)
• LAN (e.g., WiFi)
– 11 Mbps, 54 Mbps, 10 Gbps (2020)
• Wide-area (e.g., cellular)
– 3G cellular: ~ few Mbps
– 4G cellular: ~100 Mbps
– 5G cellular: ~20 Gbps
• Satellite radio channels
– Provides BW from Kbps to 45Mbps channel (or multiple smaller channels) 14
Computer Networks CS F303 BITS Pilani, Pilani Campus
Internet structure: network of networks
access access
net net
access
net
access
net
access
net
access
net
access access
net access net
net
15
access
net
access
net
access
net
access
net
access access
net access net
net
16
Computer Networks CS F303 BITS Pilani, Pilani Campus
Internet structure: network of networks
Option: Connect each access ISP to a global transit ISP?
access access
net net
access
net
access
access net
net
access
access net
net
global
access
net
ISP access
net
access
net
access
net
access
net
access
net
access access
net access net
net
17
Computer Networks CS F303 BITS Pilani, Pilani Campus
Internet structure: network of networks
Single global ISP does not scale, there are multiple global ISPs ….
access access
net net
access
net
access
access net
net
access
access net
net
ISP A
access access
net ISP B net
access
ISP C
net
access
net
access
net
access
net
access access
net access net
net
18
Computer Networks CS F303 BITS Pilani, Pilani Campus
Internet structure: network of networks
access
IXP access
net
net
ISP A
access
ISP C
net
access
net
access
IXP access
net
net
ISP A
access
ISP C
net
access
net
access
net regional net
access
net
access access
net access net
net
20
Computer Networks CS F303 BITS Pilani, Pilani Campus
Internet structure: network of networks
… and content provider networks (e.g., Google, Microsoft, Akamai ) may run their own network, to bring
services, content close to end users
access access
net net
access
net
access
access net
net
access
IXP access
net
net
ISP A
Content provider network
access IXP access
net ISP B net
access
ISP B
net
access
net
access
net regional net
access
net
access access
net access net
net
21
Computer Networks CS F303 BITS Pilani, Pilani Campus
Internet structure: network of networks
IXP
22
Computer Networks CS F303 BITS Pilani, Pilani Campus
Tier-1 ISP: e.g., Sprint
POP: point-of-presence
to/from backbone
peering
… …
…
…
…
to/from customers
airplane routing airplane routing airplane routing airplane routing airplane routing
25
Computer Networks CS F303 BITS Pilani, Pilani Campus
source
message
segment
M application Layer Encapsulation
Ht M transport
datagram Hn Ht M network
frame Hl Hn Ht M link
physical
link
physical
switch
destination Hn Ht M network
M application H l Hn Ht M link Hn Ht M
Ht M transport physical
Hn H t M network
Hl Hn Ht M link router
physical
26
Computer Networks CS F303 BITS Pilani, Pilani Campus
Internet Architecture Design Goals
27
Advanced Computer Networks CS G525 BITS Pilani, Pilani Campus
Internet Hourglass Architecture
TCP UDP…
Applications
28
Computer Networks CS F303 BITS Pilani, Pilani Campus
Internet History
Source: https://ventcube.com/history-of-the-internet-timeline/
• How will the Internet look like after 10 years from now?
• Interested to know the journey of the Internet?
– A Brief History of the Internet [Leiner et. al., 2003]
29
Advanced Computer Networks CS G525 BITS Pilani, Pilani Campus
• Internet design philosophy
– The Design Philosophy of The DARPA Internet
Protocols [Clark 1988]
30
Advanced Computer Networks CS G525 BITS Pilani, Pilani Campus
The Network Core
31
frequency
time
TDM
frequency
time 32
Computer Networks CS F303 BITS Pilani, Pilani Campus
Circuit Switch: Numerical example
• How long does it take to send a file of 640,000 bits from host A to host B
over a circuit-switched network?
– All links are 1.536 Mbps
– Each link uses TDM with 24 slots/sec
– 500 msec to establish end-to-end circuit
33
Computer Networks CS F303 BITS Pilani, Pilani Campus
Packet switching vs. Circuit switching
• Circuit-switching:
– How many users are supported?
L bits
per packet
3 2 1
source destination
R bps R bps
• Store and forward: entire packet must arrive at One-hop numerical example:
router before it can be transmitted on next link L = 10 Kbits
• Packet transmission delay: takes L/R seconds to R = 100 Mbps
transmit (push out) L-bit packet into link at R bps one-hop transmission delay
= 0.1 msec
26
transmission
A C
propagation
B D
nodal
processing queueing
36
Computer Networks CS F303 BITS Pilani, Pilani Campus
Transmission Delay vs. Propagation Delay -
Caravan Analogy
100 km 100 km
ten-car toll toll
caravan booth booth
37
Computer Networks CS F303 BITS Pilani, Pilani Campus
Questions???
1. How long does it take for the entire caravan to receive service at the tollbooth
(that is the time from when the first car enters service until the last car leaves the
tollbooth)?
2. Once the first car leaves the tollbooth, how long does it take until it arrives at the
next tollbooth?
3. Once the first car leaves the tollbooth, how long does it take until it enters
service at the next tollbooth?
4. Are there ever two cars in service at the same time, one at the first toll booth
and one at the second toll booth? Yes or No.
5. Are there ever zero cars in service at the same time, i.e., the caravan of cars has
finished at the first toll both but not yet arrived at the second tollbooth? Yes or
No
6. How much time does it take to lined up the caravan before the next tollbooth?
38
Computer Networks CS F303 BITS Pilani, Pilani Campus
Caravan analogy [..2]
100 km 100 km
ten-car toll toll
caravan booth booth
1. Are there ever two cars arrive at the same time, one at the first toll booth and one at the
second toll booth? Yes or No.
2. Are there ever zero cars in service at the same time, i.e., the caravan of cars has finished at
the first toll both but not yet arrived at the second tollbooth? Yes or No
39
Computer Networks CS F303 BITS Pilani, Pilani Campus
Queuing Delay
• R=link bandwidth (bps)
• L=packet length (bits)
• a=average packet arrival rate
La/R > 1: more “work” arriving than can be serviced, average delay infinite!
La/R <= 1: delays become large
La/R ~ 0: average queueing delay small
40
Computer Networks CS F303 BITS Pilani, Pilani Campus
“Real” Internet delays and routes
3 probes
41
Computer Networks CS F303 BITS Pilani, Pilani Campus
Real Internet delays and routes
B
packet arriving to
full buffer is lost
34
link capacity
pipe that can carry linkthat
pipe capacity
can carry
Rsfluid
bits/sec
at rate Rfluid
c bits/sec
at rate
serverserver,
sends with
bits
(fluid) into pipe (Rs bits/sec) (Rc bits/sec)
file of F bits 44
to send to client
Computer Networks CS F303 BITS Pilani, Pilani Campus
Throughput
Throughput: rate (bits/time) at which bits are being sent from sender to receiver
• Instantaneous: rate at given point in time
• Average: rate over longer period of time
link capacity
pipe that can carry linkthat
pipe capacity
can carry
Rsfluid
bits/sec
at rate Rfluid
c bits/sec
at rate
serverserver,
sends with
bits
(fluid) into pipe (Rs bits/sec) (Rc bits/sec)
file of F bits 45
to send to client
Computer Networks CS F303 BITS Pilani, Pilani Campus
Throughput: network scenario
Rs
Rs Rs
Rc Rc
Rc
47
Computer Networks CS F303 BITS Pilani, Pilani Campus
We have learned so far…
49
Computer Networks CS F303 BITS Pilani, Pilani Campus
Computer Networks (CS F303)
Virendra Singh Shekhawat
BITS Pilani Department of Computer Science and Information Systems
Pilani Campus
Application Layer
• Client-server
• Peer-to-Peer (P2P)
• Hybrid of client-server and P2P
4
Computer Networks (CS F303) BITS Pilani, Pilani Campus
Client-Server Architecture
Server:
– “always-on” host
– Permanent IP address
– For scaling, data center is used to create
large powerful virtual server
Clients:
– Communicate with server
– May be intermittently connected
– May have dynamic IP addresses
– Clients do not communicate directly
with each other
5
Computer Networks (CS F303) BITS Pilani, Pilani Campus
Pure P2P Architecture
• No “always-on” server
• Arbitrary end systems directly communicate
• Peers are connected and change IP addresses
– Example: Freenet and BitTorrent (File Sharing Apps)
6
Computer Networks (CS F303) BITS Pilani, Pilani Campus
Hybrid of CS and P2P
Skype
– Internet telephony application
– Finding address of remote party: centralized server(s)
– Client-client connection is direct (not through server)
Instant messaging
– Chatting between two users is P2P
– Presence detection/location centralized:
• User registers its IP address with central server when it comes online
• User contacts central server to find IP addresses of buddies
7
Computer Networks (CS F303) BITS Pilani, Pilani Campus
How do Network Applications Communicate?
• Data loss
– Some apps (e.g., audio, video) can tolerate some loss
– Other apps (e.g., file transfer, telnet) require 100% reliable data transfer
• Bandwidth
– Some apps (e.g., multimedia) require minimum amount of bandwidth to be
“effective”
– Other apps (“elastic apps”) make use of whatever bandwidth they get
– ex. E-mail, File Transfer
• Timing
– Some apps (e.g., Internet telephony, interactive games) require low delay to be
“effective”
10
Computer Networks (CS F303) BITS Pilani, Pilani Campus
Web and HTTP [1994]
Web page consists of objects
• Object can be HTML file, JPEG image, Java applet,
audio file,…
• Web page consists of base HTML-file which
includes several referenced objects
• Each object is addressable by a URL
• Example URLs:
https://www.bits-pilani.ac.in/pilani/computerscience/ProgrammesOffered
https://www.bits-pilani.ac.in/pilani/computerscience/Faculty
11
Computer Networks (CS F303) BITS Pilani, Pilani Campus
HTTP Protocol Overview [.1]
12
Computer Networks (CS F303) BITS Pilani, Pilani Campus
HTTP Protocol Overview [..2]
Uses TCP:
• Client initiates TCP connection (creates
socket) to server at port 80
• Server accepts TCP connection from client initiate TCP
connection
RTT
13
Computer Networks (CS F303) BITS Pilani, Pilani Campus
HTTP Request Message
data, e.g.,
requested
HTML file
15
Computer Networks (CS F303) BITS Pilani, Pilani Campus
HTTP Method Types
HTTP/1.0
• GET HTTP/1.1
– Include user data in URL field of HTTP GET • Additional methods
request message (following a ‘?’): • PUT
• https://www.bitsadmission.com/bitsatmain.aspx?id – Uploads file in entity body to path
=11012016 specified in URL field
• POST • DELETE
– User input sent from client to server in entity – Deletes file specified in the URL
body of HTTP POST request message field
• HEAD
– Asks server to leave requested object out of
response 16
Computer Networks (CS F303) BITS Pilani, Pilani Campus
HTTP Response status Codes
200 OK
– request succeeded, requested object later in this msg
301 Moved Permanently
– requested object moved, new location specified later in this msg (Location:)
400 Bad Request
– request msg not understood by server
404 Not Found
– requested document not found on this server
505 HTTP Version Not Supported
– the HTTP version used in the request is not supported by the server.
17
Computer Networks (CS F303) BITS Pilani, Pilani Campus
How does a Webpage transfer?
• Let’s assume a web page consists of a base HTML file and 5 JPEG images.
Non-persistent HTTP
• At most one object is sent over a TCP connection
• HTTP/1.0 uses non-persistent HTTP
Persistent HTTP
• Multiple objects can be sent over single TCP connection between client and server.
• Persistent with Pipeline vs. Persistent without Pipeline
• HTTP/1.1 uses persistent connections in default mode
18
Computer Networks (CS F303) BITS Pilani, Pilani Campus
State in HTTP using “Cookies”
client server
ebay 8734
usual http request msg Amazon server
cookie file creates ID
usual http response
1678 for user create backend
ebay 8734
set-cookie: 1678 entry database
amazon 1678
usual http request msg
cookie: 1678 cookie- access
specific
usual http response msg action
3 4
6 5
HTTP GET
Referer: NY Times Sports
4
7493: NY Times sports, 2/15/22
5
“third party” cookie – HTTP reply
from website you did not NY Times: 1634 Set cookie: 7493
choose to visit AdX: 7493
AdX.com
21
Computer Networks (CS F303) BITS Pilani, Pilani Campus
Cookies: tracking a user’s browsing behavior
nytimes.com AdX:
tracks my web browsing
socks.com over sites with AdX ads
2
HTTP 1 can return targeted ads
GET based on browsing history
HTTP GET
Referer: socks.com, cookie: 7493
4
7493: NY Times sports, 2/15/22
5 7493: socks.com, 2/16/22
HTTP reply
NY Times: 1634 Set cookie: 7493
AdX: 7493
AdX.com
22
Computer Networks (CS F303) BITS Pilani, Pilani Campus
Cookies: tracking a user’s browsing behavior (one day later)
nytimes.com (arts)
socks.com HTTP HTTP
GET reply
cookie: 1634 Set cookie: 1634
HTTP GET
Referer:nytimes.com, cookie: 7493
4
7493: NY Times sports, 2/15/22
5 7493: socks.com, 2/16/22
HTTP reply 7493: NY Times arts, 2/15/22
NY Times: 1634 Set cookie: 7493
AdX: 7493 Returned ad for socks!
AdX.com
23
Computer Networks (CS F303) BITS Pilani, Pilani Campus
Web Caches (aka Proxy Server)
Goal: satisfy client requests without involving origin server
Web
cache
client
origin
server
client
24
Computer Networks (CS F303) BITS Pilani, Pilani Campus
Conditional GET
client server
• Goal: don’t send object if cache
has up-to-date cached version HTTP request msg
If-modified-since: <date> object
not
• cache: specify date of cached HTTP response
modified
before
copy in HTTP request HTTP/1.0
<date>
304 Not Modified
If-modified-since: <date>
Scenario:
Access link rate: 1.54 Mbps origin
RTT from institutional router to server: 2 sec servers
Web object size: 100K bits public
Internet
Average request rate from browsers to origin
servers: 15/sec
Avg data rate to browsers: 1.50 Mbps
1.54 Mbps
access link
Cost: web cache (cheap!)
institutional
network
Performance: 1 Gbps LAN
LAN utilization: .? How to compute link
Access link utilization = ? utilization, delay?
Average end-end delay = ? local web cache
27
BITS Pilani, Pilani Campus
Calculating Access Link Utilization and
End-to-end Delay with Cache
Lower average end-end delay than with 154 Mbps link (and cheaper too!) 28
BITS Pilani, Pilani Campus
HTTP/1.1: HOL blocking
HTTP 1.1: client requests 1 large object (e.g., video file) and 3 smaller objects
server
O1
O2
O1 O3
O2
O3
O4
O4
Server responds in-order (FCFS) to multiple GET requests 30
BITS Pilani, Pilani Campus
HTTP/2: Stream Multiplexing
• What is a stream?
– Bi-directional sequence of frames sent over the HTTP/2 protocol
exchanged between the server and client
31
Computer Networks (CS F303) BITS Pilani, Pilani Campus
HTTP/2: Mitigating HOL blocking
O2
O3
O1
O4
33
BITS Pilani, Pilani Campus
Binary Framing Layer
34
Computer Networks (CS F303) BITS Pilani, Pilani Campus
HTTP/2.0 Connection
• Stream: A bidirectional flow of bytes
within an established connection, which
may carry one or more messages.
• Message: A complete sequence of
frames that map to a logical request or
response message.
• Frame: The smallest unit of
communication in HTTP/2, each
containing a frame header, which at a
minimum identifies the stream to which
the frame belongs.
35
Computer Networks (CS F303) BITS Pilani, Pilani Campus
Domain Name System (DNS)
• The domain name system maps the name people use to locate a website to
the IP address that a computer uses to locate a website.
36
Computer Networks CS F303 BITS Pilani, Pilani Campus
What happens when a browser requests a
URL?
• User machine runs the client side of the DNS application
• The browser extracts the hostname from the URL and passes
the hostname to the client side of the DNS application
• The DNS client sends a query to a DNS server
• The DNS client receives a reply with IP address of the
hostname
• The browser initiates a TCP connection to the HTTP server
located at port 80
37
Computer Networks (CS F303) BITS Pilani, Pilani Campus
DNS Structure – Distributed Hierarchical
Database
Root DNS Servers
… …
39
Computer Networks CS F303 BITS Pilani, Pilani Campus
Top-Level Domain, and Authoritative Servers
Top-Level Domain (TLD) servers:
Responsible for .com, .org, .net, .edu, .aero, .jobs, .museums, and all top-level
country domains, e.g.: .cn, .uk, .fr, .ca, .jp
Network Solutions: authoritative registry for .com, .net TLD
Educause: .edu TLD
• Load distribution
– Replicated Web servers: many IP addresses correspond to one name
41
Computer Networks CS F303 BITS Pilani, Pilani Campus
DNS Query Processing - Recursive root DNS server
2 3
7
6
Recursive query: TLD DNS
Puts burden of name resolution server
on contacted name server local DNS server
Heavy load at upper levels of dns.poly.edu 5 4
hierarchy? 1 8
gaia.cs.umass.edu
42
Computer Networks CS F303 BITS Pilani, Pilani Campus
DNS Query Processing - Iterative root DNS server
2
• TLD server may know only of an 3
intermediate DNS server for the TLD DNS server
4
hostname, which in turn knows the
authoritative DNS server for the 5
hostname. local DNS server
dns.poly.edu
7 6
1
• DNS responses are usually cached to 8
43
Computer Networks CS F303 BITS Pilani, Pilani Campus
DNS Records
DNS: distributed database for storing resource records (RR)
RR format: (name, value, type, ttl)
type=A type=CNAME
name is hostname name is alias name for some
value is IP address
“canonical” (the real) name
www.ibm.com is really
type=NS servereast.backup2.ibm.com
– name is domain (e.g., foo.com) value is canonical name
– value is hostname of authoritative
name server for this domain type=MX
value is canonical name of mailserver
associated with name, i.e., mail
server aliasing
44
Computer Networks CS F303 BITS Pilani, Pilani Campus
DNS Messages
• Query and reply messages, both with same message format
• Explore DNS protocol in Lab Session #2 2 bytes 2 bytes
46
Computer Networks CS F303 BITS Pilani, Pilani Campus
FTP: File Transfer Protocol
file transfer
FTP FTP FTP
user client server
interface
user
at host remote file
local file system
system
47
Computer Networks CS F303 BITS Pilani, Pilani Campus
FTP: Connections
48
Computer Networks CS F303 BITS Pilani, Pilani Campus
FTP Commands and Responses
49
Computer Networks CS F303 BITS Pilani, Pilani Campus
eMail
outgoing
user message queue
Three major components: agent
user mailbox
• User agents mail user
server
– e.g., Outlook, Thunderbird agent
50
Computer Networks CS F303 BITS Pilani, Pilani Campus
SMTP [RFC 5321, Original RFC 821]
• Uses TCP to reliably transfer email message from client to server, port 25
• Direct transfer: sender’s mail server to receiver’s mail server
• Three phases of transfer
– Handshaking (greeting)Transfer of messagesConnection Closure
• Command/response interaction (like HTTP, FTP)
– Commands: ASCII text
– Response: status code and phrase
• Messages must be in 7-bit ASCII
– Painful for multimedia data
51
Computer Networks CS F303 BITS Pilani, Pilani Campus
Mail Transfer Process
S: 220 hamburger.edu
C: HELO crepes.fr
S: 250 Hello crepes.fr, pleased to meet you
C: MAIL FROM: <[email protected]>
S: 250 [email protected]... Sender ok
C: RCPT TO: <[email protected]>
S: 250 [email protected] ... Recipient ok
C: DATA
S: 354 Enter mail, end with "." on a line by itself
C: Do you like ketchup?
C: How about pickles?
C: .
S: 250 Message accepted for delivery
C: QUIT
S: 221 hamburger.edu closing connection 52
Computer Networks CS F303 BITS Pilani, Pilani Campus
Mail Access Protocols
55
Computer Networks (CS F303) BITS Pilani, Pilani Campus
Thank You!
56
Computer Networks (CS F303) BITS Pilani, Pilani Campus
Computer Networks (CS F303)
Virendra Singh Shekhawat
BITS Pilani Department of Computer Science and Information Systems
Pilani Campus
Today’s Agenda
2
Computer Networks (CS F303) BITS Pilani, Pilani Campus
Peer to Peer (P2P) Architecture
• No always-on server
• Arbitrary end systems directly communicate
• Peers are intermittently connected
• Examples
– File distribution (BitTorrent)
– Streaming (KanKan)
– VoIP (Skype)
3
Computer Networks CS F303 BITS Pilani, Pilani Campus
File Distribution: P2P vs CS
How much time required to distribute file (size F) from one server to N peers?
– Peer upload/download capacity is limited resource
4
Computer Networks CS F303 BITS Pilani, Pilani Campus
File Distribution Time – Client Server
• Server transmission: must F
sequentially send (upload) N us
file copies: di
network
– Time to send N copies: NF/us ui
time to distribute F
to N clients using
client-server approach Dc-s > max{NF/us,,F/dmin}
5
Computer Networks CS F303 BITS Pilani, Pilani Campus
File Distribution Time - Peer to Peer
• Server transmission: must upload at least one copy
F
– time to send one copy: F/us us
di
Client: each client must download file copy network
Slowest client download time: F/dmin ui
Time to distribute F
to N clients using
P2P approach
DP2P > max{F/us,,F/dmin,,NF/(us + Sui)}
6
Computer Networks CS F303 BITS Pilani, Pilani Campus
Exercise
7
Computer Networks (CS F303) BITS Pilani, Pilani Campus
CS vs P2P: Example
1.5
0.5
0
0 5 10 15 20 25 30 35
N
8
Computer Networks CS F303 BITS Pilani, Pilani Campus
P2P File Distribution Example: BitTorrent
9
Computer Networks CS F303 BITS Pilani, Pilani Campus
The lookup problem
N2 N3
N1
Internet
Key = “data item”
Value = video lecture ?
Client
Publisher
N4 N6 Lookup(“data item”)
N5
Decentralized network with several peers (servers/clients)
How to find specific peer that hosts desired data within this network?
10
Computer Networks CS F303 BITS Pilani, Pilani Campus
P2P Protocols
Napster
Gnutella
Kazaa (Skype is based on Kazaa)
11
Computer Networks CS F303 BITS Pilani, Pilani Campus
Distributed Hash Table (DHT)
• Key-value pairs are distributed across peers.
• Any Peer can query the distributed database with a particular key.
• Each peer only hold a small subset of the total key-value pairs.
• Any Peer can insert new (key, value) pairs into the DB.
12
Computer Networks CS F303 BITS Pilani, Pilani Campus
DHT Implementation [.1]
• Randomly scatter the (key, value) pairs across all the peers.
• The peers containing the (key, value) pairs that match the key can respond
with matching pairs.
13
Computer Networks CS F303 BITS Pilani, Pilani Campus
DHT Implementation [..2]: Circular DHT
• Hash function assigns each “node” and “key” an m-bit identifier using a
base hash function such as SHA-1
– Node_ID = hash(IP, Port)
N63
– Key_ID = hash(original key) N60 N2
k7
ID Space: 0 to 2m-1 k58
N10
Here: m = 6 k11
N50 k16
Range = 64
k46 N20
Assign (key-value) pair to the peer that has N40 k39 k25
Algorithm complexity??? 15
Computer Networks CS F303 BITS Pilani, Pilani Campus
Scalable node localization
• Each node n contains a routing table with up-to m entries
(m: number of bits of the identifier) => finger table
• ith entry in the table at node n contains the first node s that
succeds n by at least 2i-1
– s = successor (n + 2i-1)
– s is called the ith finger of node n
16
Computer Networks CS F303 BITS Pilani, Pilani Campus
Scalable node localization: Algorithm
• Clients and servers communicate with each other by reading from and writing
to socket descriptors.
application application
socket controlled by
process process app developer
transport transport
network network controlled
link by OS
link Internet
physical physical
20
Computer Networks (CS F303) BITS Pilani, Pilani Campus
Socket Programming [..2]
Application Example:
1. Client reads a line of characters (data) from its keyboard and
sends the data to the server.
2. The server receives the data and converts characters to
uppercase.
3. The server sends the modified data to the client.
4. The client receives the modified data and displays the line on
its screen.
21
Computer Networks (CS F303) BITS Pilani, Pilani Campus
Socket Programming with TCP
Application viewpoint:
TCP provides reliable, in-order byte-stream transfer (“pipe”) between client
and server.
22
Computer Networks (CS F303) BITS Pilani, Pilani Campus
Socket Structure [.1]
struct sockaddr
{
unsigned short int sa_family; // address family, AF_xxx
char sa_data[14] ; // 14 bytes of protocol address
}
23
Computer Networks (CS F303) BITS Pilani, Pilani Campus
Socket Structure [..2]
• Parallel structure to sockaddr
struct sockaddr_in
{
short int sin_family; // Address family (e.g., AF_INET)
unsigned short int sin_port; // Port number (e.g., htons (2240)
struct in_addr sin_addr; // Internet address
unsigned char sin_zero[8]; // same size as sockaddr
}
struct in_addr
{ unsigned long s_addr;
}
• sin_zero is used to pad the structure to the length of a structure sockaddr and hence is set to all zeros with
the function memset()
• Important – you can cast sockaddr_in to a pointer of type struct sockaddr and vice versa
• sin_family corresponds to sa_family and should be set to “AF_INET”.
• sin_port and sin_addr must be in NBO
24
Computer Networks (CS F303) BITS Pilani, Pilani Campus
NBO & HBO Conversion Functions
• Very Important: Even if your machine is Big-Endian m/c, but you put your bytes in NBO
before putting them on to the network for portability
25
Computer Networks (CS F303) BITS Pilani, Pilani Campus
Primary Socket System Calls
26
Computer Networks (CS F303) BITS Pilani, Pilani Campus
Socket System Calls: Connection-
Oriented (e.g., TCP)
27
Computer Networks (CS F303) BITS Pilani, Pilani Campus
Socket Programming with UDP
29
Computer Networks (CS F303) BITS Pilani, Pilani Campus
Socket System Calls [.1]
30
Computer Networks (CS F303) BITS Pilani, Pilani Campus
Socket System Calls [..2]
31
Computer Networks (CS F303) BITS Pilani, Pilani Campus
Socket System Calls […3]
• SEND: int send(int sockfd, const void *msg, int len, int flags);
– msg: message you want to send
– len: length of the message
– flags := 0
– returned: the number of bytes actually sent
• RECEIVE: int recv(int sockfd, void *buf, int len, unsigned int flags);
– buf: buffer to receive the message
– len: length of the buffer (“don’t give me more!”)
– flags := 0
– returned: the number of bytes received
32
Computer Networks (CS F303) BITS Pilani, Pilani Campus
Socket System Calls [….4]
• SEND (DGRAM-style): int sendto(int sockfd, const void *msg, int len, int flags, const struct sockaddr *to, int
tolen);
– msg: message you want to send
– len: length of the message
– flags := 0
– to: socket address of the remote process
– tolen: = sizeof(struct sockaddr)
– returned: the number of bytes actually sent
• RECEIVE (DGRAM-style): int recvfrom(int sockfd, void *buf, int len, unsigned int flags, struct sockaddr
*from, int *fromlen);
– buf: buffer to receive the message
– len: length of the buffer (“don’t give me more!”)
– from: socket address of the process that sent the data
– fromlen:= sizeof(struct sockaddr)
– flags := 0
– returned: the number of bytes received
#include <sys/types.h>
#include <netinet/in.h>
35
Computer Networks (CS F303) BITS Pilani, Pilani Campus
Simple TCP Client
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#define SERVER_PORT 5888
int main()
{ int sockfd, clifd,len;
char buf[256];
struct sockaddr_in servaddr;
sockfd = socket( AF_INET, SOCK_STREAM, 0);
if (sockfd < 0) { printf(“ Server socket error"); exit(1); }
servaddr.sin_family = AF_INET;
servaddr.sin_port = htons(SERVER_PORT);
servaddr.sin_addr.s_addr = inet_addr(“172.24.2.4”);
read(sockfd, buf,256);
printf(“Client Received%s\n",buf);
close(sockfd);
}
36
Computer Networks (CS F303) BITS Pilani, Pilani Campus
Simple UDP Server
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#define SERVER_PORT 9988
int main()
{ int sockfd, clilen;
char buf[256];
struct sockaddr_in servaddr, cliaddr;
sockfd = socket( AF_INET, SOCK_DGRAM, 0);
servaddr.sin_family = AF_INET;
servaddr.sin_port = htons(SERVER_PORT);
servaddr.sin_addr.s_addr =htonl(INADDR_ANY);
if (bind(sockfd,(struct sockaddr*)&servaddr,sizeof(servaddr)) <0 )
{ printf(“Server Bind Error”); exit(1); }
for(; ; )
{ clilen= sizeof(cliaddr);
recvfrom(sockfd,buf,256,0,(struct sockaddr*)&cliaddr,&clilen);
printf(“Server Received:%s\n”,buf);
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
printf(“Enter Message\n”);
#define SERVER_PORT 9988 fgets(buf,255,stdin);
#define SERVER_IPADDR “172.24.2.4” len= sizeof(server);
int main()
{ int sockfd,len; sendto(sockfd,buf,strlen(buf), 0,(struct
char buf[256]; sockaddr*)&servaddr,len);
struct sockaddr_in ,cliaddr,servaddr;
recvfrom(sockfd,buf,256,0,NULL,NULL);
servaddr.sin_family = AF_INET; printf(“Clinet Received: %s \n”,buf);
servaddr.sin_port = htons(SERVER_PORT); close(sockfd);
servaddr.sin_addr.s_addr = inet_addr(SERVER_IPADDR); }
cliaddr.sin_family = AF_INET;
cliaddr.sin_port = htons(0);
cliaddr.sin_addr.s_addr =htonl(INADDR_ANY);
bind(sockfd,(struct sockaddr*)&cliaddr,sizeof(cliaddr));
38
Computer Networks (CS F303) BITS Pilani, Pilani Campus
Thank You!
39
Computer Networks (CS F303) BITS Pilani, Pilani Campus
Computer Networks (CS F303)
Virendra Singh Shekhawat
BITS Pilani Department of Computer Science and Information Systems
Pilani Campus
Topics
• Transport Layer
– Transport Layer Services
• Multiplexing/Demultiplexing
– Connectionless and Connection Oriented
» TCP and UDP
• Reliable data transfer
• Flow control
• Congestion control
2
Computer Networks (CS F303) BITS Pilani, Pilani Campus
Transport Layer Services and Protocols
3
Computer Networks (CS F303) BITS Pilani, Pilani Campus
TP Layer vs. Network Layer
• Network layer: logical communication between hosts
• But certain services can be offered by the TP layer even when the network
layer doesn’t offer
– e.g., Reliable data transfer
4
Computer Networks (CS F303) BITS Pilani, Pilani Campus
Transport Layer Services
5
Computer Networks (CS F303) BITS Pilani, Pilani Campus
How a receiving host directs an incoming
segment to the appropriate socket?
multiplexing as sender: demultiplexing as receiver:
Handle data from multiple Use header info to deliver
sockets, add transport header received segments to correct
socket
application
6
Computer Networks (CS F303) BITS Pilani, Pilani Campus
How demultiplexing works?
7
Computer Networks (CS F303) BITS Pilani, Pilani Campus
Connectionless (UDP) Demultiplexing
application P4 P5 P6 application
P3 P2 P3
transport
transport transport
network
network link network
link physical link
physical server: IP physical
address B
11
Computer Networks (CS F303) BITS Pilani, Pilani Campus
Example: Threaded Server
threaded server
application
application application
P4
P3 P2 P3
transport
transport transport
network
network link network
link physical link
physical server: IP physical
address B
13
Computer Networks (CS F303) BITS Pilani, Pilani Campus
UDP Segment Header
length, in bytes of
32 bits UDP segment,
source port # dest port # including header
length checksum
Why is there a UDP?
• No connection establishment
application
(which can add delay)
data
(payload) • Simple: no connection state
at sender, receiver
• Small header size
UDP segment format • No congestion control: UDP
can blast away as fast as
desired
14
Computer Networks (CS F303) BITS Pilani, Pilani Campus
UDP Checksum
• At the receiver, all 16-bit words are added (including checksum) to detect
error in segment.
15
Computer Networks (CS F303) BITS Pilani, Pilani Campus
User Datagram Protocol [RFC 768]
16
Computer Networks (CS F303) BITS Pilani, Pilani Campus
Principles of Reliable Data Transfer
17
Computer Networks (CS F303) BITS Pilani, Pilani Campus
Principles of Reliable Data Transfer
send receive
side side
We will:
• Incrementally develop sender, receiver sides of reliable data
transfer protocol (rdt)
• Consider only unidirectional data transfer
– But control info will flow on both directions!
• Use finite state machines (FSM) to specify sender, receiver
event causing state transition
actions taken on state transition
State: when in this “state”
next state uniquely state state
1 event
determined by next 2
event actions
20
Computer Networks (CS F303) BITS Pilani, Pilani Campus
rdt1.0: reliable transfer over a reliable channel
sender receiver
21
Computer Networks (CS F303) BITS Pilani, Pilani Campus
rdt2.0: channel with bit errors
• Underlying channel may flip bits in packet
– Don’t worry… Checksum is there to detect bit errors
rdt_rcv(rcvpkt) &&
notcorrupt(rcvpkt)
extract(rcvpkt,data)
deliver_data(data)
udt_send(ACK)
24
Computer Networks (CS F303) BITS Pilani, Pilani Campus
rdt2.0: Error Scenario
rdt_send(data)
sndpkt = make_pkt(data, checksum)
udt_send(sndpkt)
rdt_rcv(rcvpkt) &&
isNAK(rcvpkt)
Wait for call Wait for rdt_rcv(rcvpkt) &&
from above ACK or udt_send(sndpkt) corrupt(rcvpkt)
NAK
udt_send(NAK)
rdt_rcv(rcvpkt) &&
notcorrupt(rcvpkt)
extract(rcvpkt,data)
deliver_data(data)
udt_send(ACK)
25
Computer Networks (CS F303) BITS Pilani, Pilani Campus
rdt2.0 Has a fatal flaw!
26
Computer Networks (CS F303) BITS Pilani, Pilani Campus
rdt2.1: Sender, handles garbled ACK/NAKs
rdt_send(data)
sndpkt = make_pkt(0, data, checksum)
udt_send(sndpkt) rdt_rcv(rcvpkt) &&
(corrupt(rcvpkt) ||
Wait for Wait for isNAK(rcvpkt) )
call 0 from ACK or
NAK 0 udt_send(sndpkt)
above
rdt_rcv(rcvpkt)
rdt_rcv(rcvpkt)
&& notcorrupt(rcvpkt) &&
&& notcorrupt(rcvpkt)
isACK(rcvpkt)
&& isACK(rcvpkt)
L
L
Wait for Wait for
ACK or call 1 from
rdt_rcv(rcvpkt) NAK 1 above
&& (corrupt(rcvpkt) ||
isNAK(rcvpkt) ) rdt_send(data)
27
Computer Networks (CS F303) BITS Pilani, Pilani Campus
rdt2.1: Receiver, handles garbled ACK/NAKs
extract(rcvpkt,data)
deliver_data(data)
sndpkt = make_pkt(ACK, chksum)
udt_send(sndpkt)
28
Computer Networks (CS F303) BITS Pilani, Pilani Campus
rdt2.1: Discussion
Sender:
• Seq # added to pkt
• Two seq. #’s (0,1) will suffice. Why?
• Must check if received ACK/NAK corrupted
• Twice as many states
– State must “remember” whether “current” pkt has 0 or 1 seq. #
Receiver:
• Must check if received packet is duplicate
– State indicates whether 0 or 1 is expected pkt seq #
– For an out of order received packet, it sends ACK for it
29
Computer Networks (CS F303) BITS Pilani, Pilani Campus
rdt2.2: NAK Free Protocol
• New assumption: Underlying channel can also lose packets (data or ACKs)
– Checksum, seq. #, ACKs, retransmissions will be of help, but not enough. Why???
31
Computer Networks (CS F303) BITS Pilani, Pilani Campus
rdt 3.0 Sender
rdt_send(data)
sndpkt = make_pkt(0, data, checksum)
udt_send(sndpkt)
start_timer
rdt_send(data)
sndpkt = make_pkt(1, data, checksum)
udt_send(sndpkt)
start_timer
32
Computer Networks (CS F303) BITS Pilani, Pilani Campus
rdt 3.0 Sender
rdt_send(data)
rdt_rcv(rcvpkt) &&
sndpkt = make_pkt(0, data, checksum) ( corrupt(rcvpkt) ||
udt_send(sndpkt) isACK(rcvpkt,1) )
rdt_rcv(rcvpkt) start_timer L
L Wait for Wait
for timeout
call 0 from
ACK0 udt_send(sndpkt)
above
start_timer
rdt_rcv(rcvpkt)
&& notcorrupt(rcvpkt) rdt_rcv(rcvpkt)
&& isACK(rcvpkt,1) && notcorrupt(rcvpkt)
stop_timer && isACK(rcvpkt,0)
stop_timer
Wait Wait for
timeout for call 1 from
udt_send(sndpkt) ACK1 above
start_timer rdt_rcv(rcvpkt)
rdt_send(data) L
rdt_rcv(rcvpkt) &&
( corrupt(rcvpkt) || sndpkt = make_pkt(1, data, checksum)
isACK(rcvpkt,0) ) udt_send(sndpkt)
start_timer
L
33
Computer Networks (CS F303) BITS Pilani, Pilani Campus
rdt 3.0 Receiver
34
Computer Networks (CS F303) BITS Pilani, Pilani Campus
rdt 3.0 Sender and Receiver
35
Computer Networks (CS F303) BITS Pilani, Pilani Campus
rdt3.0 – No Loss
sender receiver
send pkt0 pkt0
rcv pkt0
ack0 send ack0
rcv ack0
send pkt1 pkt1
rcv pkt1
ack1 send ack1
rcv ack1
send pkt0 pkt0
rcv pkt0
ack0 send ack0
36
Computer Networks (CS F303) BITS Pilani, Pilani Campus
rdt3.0 – Data packet Loss
sender receiver
send pkt0 pkt0
rcv pkt0
ack0 send ack0
rcv ack0
send pkt1 pkt1
X
loss
timeout
resend pkt1 pkt1
rcv pkt1
ack1 send ack1
rcv ack1
send pkt0 pkt0
rcv pkt0
ack0 send ack0
37
Computer Networks (CS F303) BITS Pilani, Pilani Campus
rdt3.0 – ACK Loss
sender receiver
send pkt0 pkt0
rcv pkt0
ack0 send ack0
rcv ack0
send pkt1 pkt1
rcv pkt1
ack1 send ack1
X
loss
timeout
resend pkt1 pkt1
rcv pkt1
(detect duplicate)
ack1 send ack1
rcv ack1
send pkt0 pkt0
rcv pkt0
ack0 send ack0
38
Computer Networks (CS F303) BITS Pilani, Pilani Campus
rdt3.0 – Premature Timeout / Delayed ACK
sender receiver
send pkt0
pkt0
rcv pkt0
send ack0
ack0
rcv ack0
send pkt1 pkt1
rcv pkt1
send ack1
ack1
timeout
resend pkt1
pkt1 rcv pkt1
rcv ack1 (detect duplicate)
send pkt0 pkt0 send ack1
ack1 rcv pkt0
rcv ack1 send ack0
(ignore) ack0
pkt1
39
Computer Networks (CS F303) BITS Pilani, Pilani Campus
Rdt3.0 Stop and Wait Performance
Example: 1 Gbps link, 15 ms prop. delay, 8000 bit packet sender receiver
L/R L/R
Usender=
RTT + L / R
.008 RTT
=
30.008
= 0.00027
41
Computer Networks (CS F303) BITS Pilani, Pilani Campus
Pipelining: Increased Utilization
sender receiver
first packet bit transmitted, t = 0
last bit transmitted, t = L / R
Increase utilization
by a factor of 3!
U 3*L/R .024
= = = 0.0008
sender 30.008
RTT + L / R microsecon
ds
42
Computer Networks (CS F303) BITS Pilani, Pilani Campus
Pipelining Protocols Requirements
43
Computer Networks (CS F303) BITS Pilani, Pilani Campus
Go-Back-N in Action
sender window (N=4) sender receiver
012345678 send pkt0
012345678 send pkt1
012345678 send pkt2 receive pkt0, send ack0
012345678 send pkt3 Xloss receive pkt1, send ack1
(wait)
receive pkt3, discard,
012345678 rcv ack0, send pkt4 (re)send ack1
012345678 rcv ack1, send pkt5 receive pkt4, discard,
(re)send ack1
ignore duplicate ACK receive pkt5, discard,
(re)send ack1
pkt 2 timeout
012345678 send pkt2
012345678 send pkt3
012345678 send pkt4 rcv pkt2, deliver, send ack2
012345678 send pkt5 rcv pkt3, deliver, send ack3
rcv pkt4, deliver, send ack4
rcv pkt5, deliver, send ack5
44
Computer Networks (CS F303) BITS Pilani, Pilani Campus
Go-Back-N: Sender
Sender: “window” of up to N consecutive transmitted but unACKed pkts
• k-bit seq # in pkt header
… …
rcv_base
Not received
46
Computer Networks (CS F303) BITS Pilani, Pilani Campus
GBN Sender FSM
rdt_send(data)
if (nextseqnum < base+N) {/*If we are allowed to send packets*/
sndpkt[nextseqnum] = make_pkt(nextseqnum,data,chksum)
udt_send (sndpkt [nextseqnum] )
if (base == nextseqnum) /*If there are no packets in flight*/
start_timer
nextseqnum++
}
L else
refuse_data(data)
base=0
nextseqnum=0
timeout
start_timer
Wait
udt_send(sndpkt[base])
rdt_rcv(rcvpkt) udt_send(sndpkt[base+1])
&& corrupt(rcvpkt) …
udt_send(sndpkt[nextseqnum-1])
L
rdt_rcv(rcvpkt) &&
notcorrupt(rcvpkt)
base = getacknum(rcvpkt)+1 /*Increase left size of the window*/
If (base == nextseqnum)
stop_timer
else
start_timer 47
Computer Networks (CS F303) BITS Pilani, Pilani Campus
GBN Receiver FSM
• Always send ACK for correctly-received pkt with highest in-order seq #
– Need only to remember “expectedseqnum”
• If out-of-order pkt arrived
– Discard it
– Re-ACK pkt with the highest in-order seq #
default
udt_send(sndpkt) rdt_rcv(rcvpkt)
&& notcurrupt(rcvpkt)
L && hasseqnum(rcvpkt,expectedseqnum)
expectedseqnum=0 Wait extract(rcvpkt,data)
sndpkt = deliver_data(data)
make_pkt(expectedseqnum,ACK,chksum) sndpkt = make_pkt(expectedseqnum,ACK,chksum)
udt_send(sndpkt)
expectedseqnum++
48
Computer Networks (CS F303) BITS Pilani, Pilani Campus
Selective Repeat Protocol
49
Computer Networks (CS F303) BITS Pilani, Pilani Campus
Selective Repeat in Action
sender window (N=4)
012345678 send pkt0
012345678 send pkt1
012345678 send pkt2 receive pkt0, send ack0
012345678 send pkt3 Xloss receive pkt1, send ack1
0123 (wait)
receive pkt3, buffer,
012345678 rcv ack0, send pkt4 send ack3
012345678 rcv ack1, send pkt5 receive pkt4, buffer,
send ack4
record ack3 arrived receive pkt5, buffer,
send ack5
pkt 2 timeout
012345678 send pkt2
012345678 record ack4 arrived
012345678 rcv pkt2; deliver pkt2,
record ack4 arrived
012345678 pkt3, pkt4, pkt5; send ack2
Events at Sender
Data from above
Timeout
ACK(n) in [sendbase,sendbase+N-1]
Events at Receiver
Pkt n in [rcvbase, rcvbase+N-1]
Pkt n in [rcvbase-N,rcvbase-1]
Pkt rcvd and not fall in above
ranges
51
Computer Networks (CS F303) BITS Pilani, Pilani Campus
Selective Repeat: A Dilemma!
sender window receiver window
(after receipt) (after receipt)
Example:
pkt0
Seq #s: 0, 1, 2, 3 (base 4 counting) 0123012
pkt1 0123012
0123012
Window size=3 0123012 pkt2 0123012
0123012
0123012 pkt3
X
0123012
pkt0 will accept packet
with seq number 0
0123012 pkt0
0123012 pkt1 0123012
0123012 pkt2 X 0123012
X 0123012
X
timeout
retransmit pkt0
0123012 pkt0
will accept packet
with seq number 0
52
Computer Networks (CS F303) BITS Pilani, Pilani Campus
Thank You!
53
Computer Networks (CS F303) BITS Pilani, Pilani Campus
Computer Networks (CS F303)
BITS Pilani Virendra Singh Shekhawat
Department of Computer Science and Information Systems
Pilani Campus
Topics
• Transport Layer
– TCP Protocol
• Connection Establishment
• TCP Segment Structure
• Reliable data transfer
• Flow control
• Congestion control
2
Computer Networks (CS F303) BITS Pilani, Pilani Campus
TCP [RFCs: 793,1122,1223,2018,2581]
4
Computer Networks (CS F303) BITS Pilani, Pilani Campus
TCP: Wireshark Capture
5
Computer Networks (CS F303) BITS Pilani, Pilani Campus
Connection Management
application application
network network
choose x
req_conn(x)
ESTAB
acc_conn(x)
ESTAB
7
Computer Networks (CS F303) BITS Pilani, Pilani Campus
TCP 3-way Handshake
8
Computer Networks (CS F303) BITS Pilani, Pilani Campus
TCP Retransmission Scenarios
Host A Host B Host A Host B
SendBase=92
Seq=92, 8 bytes of data Seq=92, 8 bytes of data
timeout
ACK=100
X
ACK=100
ACK=120
SendBase=120
ACK=100
X
ACK=120
window size
Acknowledgements: N
13
Computer Networks (CS F303) BITS Pilani, Pilani Campus
Is TCP GBN or SR…?
14
Computer Networks (CS F303) BITS Pilani, Pilani Campus
TCP Timeout
15
Computer Networks (CS F303) BITS Pilani, Pilani Campus
Exercise
• Suppose Host A and Host B are using TCP protocol to communicate with
each other. After the connection establishment process, Host A sends
three data segments to Host B in sequence.
– Sequence # = 100, Segment length = 100 Bytes
– Sequence # = 200, Segment length = 200 Bytes
– Sequence # = 400, Segment length = 400 Bytes
• Assume that only third segment is arrived at Host B and other two
segments have been dropped in between.
• a) What action will be taken by Host B, when the third segment is arrived?
16
Computer Networks (CS F303) BITS Pilani, Pilani Campus
RTT Estimation
EstimatedRTT = (1-)*EstimatedRTT + *SampleRTT
– Influence of past sample decreases exponentially fast
– Typical value of = 0.125 RTT: gaia.cs.umass.edu to fantasia.eurecom.fr
350
300
250
RTT (milliseconds)
200
150
100
1 8 15 22 29 36 43 50 57 64 71 78 85 92 99 106
time (seconnds)
17
Computer Networks (CS F303) BITS Pilani, Pilani Campus
Timeout Interval
• Timeout Interval
– Estimated RTT + “Safety margin”
– Large variation in Estimated RTT large safety margin
DevRTT = (1-)*DevRTT +
*|SampleRTT-EstimatedRTT|
(typically, = 0.25)
18
Computer Networks (CS F303) BITS Pilani, Pilani Campus
Excercise: Timeout Interval Calculation
• Consider three RTT samples (in ms): 150, 200 and 210 in that
order. Assume initial estimated RTT= 200 ms, initial DevRTT = 50
ms, β = 0.25 and α = 0.125
19
Computer Networks (CS F303) BITS Pilani, Pilani Campus
TCP Connection Close
LAST_ACK
FINbit=1, seq=y
TIMED_WAIT can no longer
send data
ACKbit=1; ACKnum=y+1
timed wait
for 2*max CLOSED
segment lifetime
CLOSED
20
Computer Networks (CS F303) BITS Pilani, Pilani Campus
TCP Connection States-Client and Server
21
Computer Networks (CS F303) BITS Pilani, Pilani Campus
Thank You
22
Computer Networks (CS F303) BITS Pilani, Pilani Campus