You are on page 1of 17

MCS-042 solved assignment july 2017

and january 2018 session

Q.1. Draw a figure showing congestion window Size as a function of


transmission round (time) and briefly describe how the slow does
Start algorithm work? From the figure do the following tasks:
฀Identify the interval of time when TCP slow start in operating. c o
฀Identify the interval of time when TCP congestion avoidance
t .
is Operating.
p o
฀What is the value of the threshold?
g s
A.1.
l o
. b
In the following, cwind stands for Congestion Window
e
and ssthreshold stands for Slow Start Threshold.
t
i
1. The difference between ―Flow Control‖ and ―Congestion Control‖
s
u
as applied to TCP transmission is: Flow control is the receiver
o
g n
controlling how much the sender is injecting into the network,
whereas Congestion Control is the sender sensing congestion on

.i the network by timing ACKs and controlling its sending rate.

w w 2. When the retransmission timer expires at the sender, the value


of ssthreshold is set to ½ the current cwind value.
3. cwind parameter is taken from : (e) – it is not in TCP header, but
determined solely by sending TCP.
a) sender tcp header
b) receiver tcp header
c) sender tcp's window parameter
e) receiver tcp's window
e) None of the above
4. When TCP is in slow start, receipt of 2 ACKs before timeout
results in cwind being increased by 2 MSS bytes
5. ssthreshold parameter determines when slow start ends and
congestion-avoidance takes over.
6. In congestion avoidance phase, TCP's send rate increases linearly.
7. Why does TCP Reno get rid of slow start phase when a triple
c o
duplicate ACK is received? The receipt of triple duplicate ACKs
indicates that some segments are getting through, and so
t .
p o
congestion may be less severe. Thus instead of wasting bandwidth,

s
TCP tries a more aggressive strategy, by starting cwind at the
g
value when the packet was dropped.
l o
current ssthreshold value rather than at 1 MSS. This is ½ the cwind

b
8. What is ―fast re-transmit‖? In TCP Reno, when three duplicate
.
e
ACKs are received, TCP retransmits the packet presumed lost
t
s i
without waiting for timeout. This is called fast-retransmit.
9. What is ―fast recovery‖? In TCP Reno, when TCP does fast re-

o u
transmit (see above question), instead of beginning a slow-start

g n
phase with cwind set to 1, it goes directly to congestion-avoidance

.i phase, with cwind set to ½ its value when packet loss occurred.

w w This is called fast recovery. Fast re-transmit and fast-recovery are


usually implemented together.
10. The picture below shows the behavior of a TCP Reno.
c o
t .
p o
g s
l o
b
a. Identify time intervals where TCP slow-start is operating.
.
e
TCP slowstart is operating in the intervals [1,6] and [23,26]
t
s i
b. Identify time intervals where TCP congestion-avoidance is
operating
o u
n
TCP congestion advoidance is operating in the intervals [6,16] and
g
i
[17,22]
.
w w e. What is the threshold value?

The threshold is initially 32, since it is at this window size that slowtart
stops and congestion avoidance begins.

Q.2. Compare and contrast link state and distance vector routing
algorithms.
A.2. Distance Vector Protocol
Although it’s rather disadvantages to use in larger networks, still
Distance vector protocol like RIP is used in many individual networks,
which helps to make internet. Distance vector routing protocols send
periodic full routing updates, but sometimes, these full updates are
limited by split-horizon, which is used as a loop prevention mechanism.
Split horizon does not let a route to be advertised to the same interface
c o
where the route is generated. When a router fails, it sends an
t
immediately triggered message, which is called a triggered update. After .
p o
a router learns about a failed route, it suspends split-horizon rules for
s
that route and advertises a failed route and removes it from the network.
g
o
When a route is down, every router is given a time called hold down
l
b
timer to know about that failure, and it to be removed.

.
t e
Link State Protocol
s i
u
In link state routing protocol, every node constructs a map of every
o
g n
connectivity around a router. Every router has full knowledge on to
which router it’s connected, and they add best routes to their routing

.i
tables based on metric, at last, every router in the internetwork has the

w w same information about the internetwork. When considering with


Distance Vector protocol, Link state protocol provides fast convergence,
and it reduces the possibility of creating loops in a network. Link state
protocols do not need to use a large variety of loop preventions
mechanisms. Link state protocols consume much more CPU and
memory, but when a network is properly designed, this can be reduced.
Therefore, it requires much more planning than distance vector protocol,
and it is needed to use more configurations for a better network design.
c o
t .
p o
g s
l o
. b
t e
s i
o u
g n
Q.3. Discuss how a hierarchical organization of the internet has

.i
helped to scale to million of users?

w w A.3. The Internet is basically a hierarchy that allows any Internet


connected device in one geographic location, talk to another Internet
connected device in another geographic location. The way that the
information is transmitted varies greatly, and in some countries, wireless
ham radios are even used to transmit email. Keep in mind that the word
―connected‖ is used very loosely here.
The Open Systems Interconnection (OSI) Model
The seven open systems interconnection layers (OSI) are a staple of
most networking textbooks. The idea is that a network will work on
many different levels, or ―layers‖ each of which will perform a
supporting function for the next layer.

c o
t .
p o
figure 1: open systems interconnection (OSI) model

g s
l o
The Network layers are the first three, being the physical link layer, the
link layer, and the Network layer. Since the Internet is based on the

. b
Internet protocol which is in the Network Layer, and since the Internet

t e
can run on any number of different types of layers below that, we
normally are not too concerned with the physical layers unless we are

s i
building an Ethernet cable, or transmitting an Internet signal through

o u
wireless means, and not to interested in the link layer unless we are
registering a network card or router MAC address with our service

g n
provider.
i
ww. The top three layers (session, presentation, and application layers) are
for program communication, and are completely independant of the
network so that the two communicating programs could even be on the
same machine.

We also sometimes inlcude the transport layer when discussing the


Internet, and often link the transport with the network layer as in the
TCP/IP protocols. Transmission Control Protocol (TCP) is in the
transport layer, and Internet Protocol (IP) is in the Network layer. Most
Internet based functions such as the world wide web, and email, use
TCP/IP, so this is a basic building block for the Internet.

The transport layer also makes sure that the top three layers are network
independant.

Q.4. Why are different Inter AS and Intra AS protocols used in the
Internet ?
A.4. The difference between inter- and intra-domain routing are in the
types of protocols you use. Inter-domain routing protocol examples
c o
would include BGP, OSPF, and EIGRP. These are meant for slower
t .
o
WAN connections and are less likely to saturate the link. Intra-domain
p
g s
routing protocols would be more like IGRP and RIP. They are much
more chatty and it is better to use these protocols on a limited basis
across much faster connections (LAN).
l o
. b
t e
We use the inter-domain routing protocols because they effectively

s i
replicate the routing tables on preset schedules or when certain

o u
conditions are met. IE, OSPF updates it's neighbors anytime it detects a

n
link state change anywhere on the network. BGP lets its neighbors know
g
.i
anytime the LOCAL router has a link state change. They each have their
appropriate implementations.

w w
Intra-site routing protocols however are constantly sending "hello
packets" back and forth to assess the link state and establish their routing
tables. For most intra-site routing protocols you want to try to keep the
number of routers involved to under ten.
Q.5. Compare & contrast IPV4 & IPV6 header fields. Do they have
any field in common?
A.5. IPv4 (Internet Protocol version 4) is the fourth version of the
Internet Protocol (IP). It is used on packet-switched Link Layer
networks such as Ethernet. IPv4 uses the best effort delivery method,
which does not provide a guarantee of delivery. IPv4 packet is made up
of a header and a data section. This header contains fourteen fields. IPv6
(Internet Protocol version 6) is the version of IP that followed the IPv4.
IPv6 was developed as a solution to the address exhaustion of IPv4. IPv6
packets are also made up of a header and a data section. The IPv6 header
is made up of fixed size part that could provide the main functionality
c o
and the option to extend the header to include special features.
t .
What are IPv4 Headers?
p o
g s
IHL
l o
Version
(Internet
Header
Type of
Service
. b Total Length

(4 bits)
Length)
t e (16 bits)
(4 bits)
s i (8 bits)

o u
g n Identification
Flags
Fragment Offset
i
w.
(3
(16 bits) (13 bits)
bits)
w Time to Live Protocol Header Checksum

(8 bits) (8 bits) (16 bits)

Source IP Address
(32 bits)

Destination IP Address

(32 bits)

Options Padding

(variable length) (variable length)

c o
In the IPv4 header, the source address and the destination address has
the length of 32 bits. Therefore, the IPv4 allows an address space of
t .
4.3×109 (232) addresses. Among these, some addresses are reserved for
p o
g s
special uses such as private networks or multicast addresses, which
further reduces the available number of addresses for public use.

l o
What are IPv6 Headers?
. b
Version Traffic Class
t e Flow Label

s i
(4 bits)

o u (8 bits) (20 bits)

g n Payload Length Next Header Hop Limit


i
ww. (16 bits) (8 bits)

Source Address
(8 bits)

(128 bits)

Destination Address
(128 bits)

The header of IPv4 consists of a fixed part and an extension. The fixed
part contains the source and destination addresses, a hop counter and a
reference to the extension header (if there is a one). One of the important
features in IPv6 header is the large address space. Both source and
destination addresses are allowed to have 128 bits. This would create a
3.4×1038 (2128) address space. The extension header contains special
information like information about routing, security, etc.
c o
Q.6. What is the 32-bit binary equivalence of IP address
t .
225.1.3.271?
p o
g s
A.6. 32-bit IP addressing is the IP address scheme used in Internet

l o
Protocol 4. In IPv4, an IP address is a 32-bit number that identifies each

b
sender or receiver of information that is sent in packets across the
.
Internet.
t e
s i
The 32-bit IP address is often depicted as a dot address, that is, four
u
groups (or quads) of decimal numbers separated by periods. Each of the
o
n
decimal numbers represents a string of eight binary digits. Thus, the IP
g
. i
address really is this string of 0s and 1s.

w w The 32-bit binary equivalence of IP address 225.1.3.271 is:-

11100001 00000001 00000011 100001111


Q.7.What are some of the possible services that a link layer
protocol can offer to the network layer? Which of these link-layer
services have corresponding services in IP and TCP?
A.7. Framing: there is also framing in IP and TCP; link access; reliable
delivery: there is also reliable delivery in TCP; flow control: there is also
flow control in TCP; error detection: there is also error detection in IP
and TCP; error correction; Half/full duplex: TCP is also full duplex. R2.
If all the links in the Internet were to provide reliable delivery service.
Although each link guarantees that an IP datagram sent over the link will
be received at the other end of the link without errors, it is not
guaranteed that IP datagrams will arrive at the ultimate destination in the
proper order. With IP, datagrams in the same TCP connection can take
different routes in the network, and therefore arrive out of order. TCP is
c o
still needed to provide the receiving end of the application the byte
t .
stream in the correct order. Also, IP can lose packets due to routing
loops or equipment failures. p o
g s
l o
b
Q.8. Give an overview of how DNS works? What are the services
.
application?
t e
provided by DNS? How is DNS different from an e-mail

s i
A.8. The Domain Name System (aka DNS) is used to resolve human-

o u
n
readable hostnames like www.Dyn.com into machine-readable IP
g
.i
addresses like 204.13.248.115. DNS also provides other information
about domain names, such as mail services.

w w How does DNS work?


When you visit a domain such as dyn.com, your computer follows a
series of steps to turn the human-readable web address into a machine-
c o
readable IP address. This happens every time you use a domain name,
t .
p o
whether you are viewing websites, sending email or listening to Internet
radio stations like Pandora.
g s
l o
Step 1: Request information
. b
t e
The process begins when you ask your computer to resolve a hostname,

i
such as visiting http://dyn.com. The first place your computer looks is its
s
u
local DNS cache, which stores information that your computer has
o
n
recently retrieved.
g
.i
w w If your computer doesn’t already know the answer, it needs to perform
a DNS query to find out.

Step 2: Ask the recursive DNS servers

If the information is not stored locally, your computer queries (contacts)


your ISP’s recursive DNS servers. These specialized computers
perform the legwork of a DNS query on your behalf. Recursive servers
have their own caches, so the process usually ends here and the
information is returned to the user.

Step 3: Ask the root nameservers

If the recursive servers don’t have the answer, they query the root
nameservers. A nameserveris a computer that answers questions about
domain names, such as IP addresses. The thirteen root nameservers act
c o
as a kind of telephone switchboard for DNS. They don’t know the
t .
p o
answer, but they can direct our query to someone that knows where to
find it.
g s
Step 4: Ask the TLD nameservers l o
. b
e
The root nameservers will look at the first part of our request, reading
t
i
from right to left — www.dyn.com — and direct our query to the Top-
s
u
Level Domain (TLD) nameservers for .com. Each TLD, such
o
n
as .com, .org, and .us, have their own set of nameservers, which act like
g
i
a receptionist for each TLD. These servers don’t have the information
.
w w we need, but they can refer us directly to the servers that do have the
information.

Step 5: Ask the authoritative DNS servers

The TLD nameservers review the next part of our request —


www.dyn.com — and direct our query to the nameservers responsible
for this specific domain. These authoritative nameservers are
responsible for knowing all the information about a specific domain,
which are stored in DNS records. There are many types of records,
which each contain a different kind of information. In this example, we
want to know the IP address for www.dyndns.com, so we ask the
authoritative nameserver for the Address Record (A).

Step 6: Retrieve the record


c o
The recursive server retrieves the A record for dyn.com from the
t .
p o
authoritative nameservers and stores the record in its local cache. If

g s
anyone else requests the host record for dyn.com, the recursive servers

l o
will already have the answer and will not need to go through the lookup

. b
process again. All records have a time-to-live value, which is like an

t e
expiration date. After a while, the recursive server will need to ask for a

i
new copy of the record to make sure the information doesn’t become
s
out-of-date.
o u
g n
Step 7: Receive the answer

.i
w w Armed with the answer, recursive server returns the A record back to
your computer. Your computer stores the record in its cache, reads the
IP address from the record, then passes this information to your browser.
The browser then opens a connection to the webserver and receives the
website.
This entire process, from start to finish, takes only milliseconds to
complete.
Q.9. What is a handshake mechanism? With the help of an
illustration describe how does 3-way handshake mechanism work?
A.9.
The TCP three-way handshake in Transmission Control Protocol (also
called the TCP-handshake; three message handshake and/or SYN-SYN-
ACK) is the method used by TCP set up a TCP/IP connection over an
c o
Internet Protocol based network. TCP's three way handshaking
t
technique is often referred to as "SYN-SYN-ACK" (or more accurately .
p
SYN, SYN-ACK, ACK) because there are three messages transmitted o
g s
by TCP to negotiate and start a TCP session between two computers.

o
The TCP handshaking mechanism is designed so that two computers
l
. b
attempting to communicate can negotiate the parameters of the network
TCP socket connection before transmitting data such as SSH and HTTP
web browser requests.
t e
s i
o u
This 3-way handshake process is also designed so that both ends can

g n
initiate and negotiate separate TCP socket connections at the same time.

.i
Being able to negotiate multiple TCP socket connections in both

w w directions at the same time allows a single physical network interface,


such as ethernet, to be multiplexed to transfer multiple streams of TCP
data simultaneously.

TCP 3-Way Handshake Diagram


Below is a (very) simplified diagram of the TCP 3-way handshake
process. Have a look at the diagram on the right as you examine the list
of events on the left.

SYNchronize and ACKnowledge messages are indicated by a either the


SYN bit, or the ACK bit inside the TCP header, and the SYN-
ACK message has both the SYN and the ACK bits turned on (set to 1) in
the TCP header.
TCP knows whether the network TCP socket connection is opening,
c o
synchronizing, established by using the SYNchronize
and ACKnowledge messages when establishing a network TCP socket
t .
connection.
p o
g s
When the communication between two computers ends, another 3-way

l o
communication is performed to tear down the TCP socket connection.
b
This setup and teardown of a TCP socket connection is part of what
.
t e
qualifies TCP a reliable protocol. TCP also acknowledges that data is
successfully received and guarantees the data is reassenbled in the
correct order.
s i
o u
Note that UDP is connectionless. That means UDP doesn't establish

g n
connections as TCP does, so UDP does not perform this 3-way
i
handshake and for this reason, it is referred to as an unreliable protocol.
.
w w That doesn't mean UDP can't transfer data, it just doesn't negotiate how
the conneciton will work, UDP just transmits and hopes for the
EVENT DIAGRAM

Host A sends a TCP SYNchronize packet to


Host B
Host B receives A's SYN
Host B sends a SYNchronize-
TCP Three Way
ACKnowledgement
Handshake
Host A receives B's SYN-ACK (SYN,SYN-ACK,ACK)
Host A sends ACKnowledge
c o
Host B receives ACK.
t .
TCP socket connection is ESTABLISHED.
p o
g s
l o
. b
t e
s i
o u
g n
.i
w w

You might also like