Download - Saraswathi Velu College of Engineering

navybeansvietnameseΔίκτυα και Επικοινωνίες

24 Οκτ 2013 (πριν από 3 χρόνια και 11 μήνες)

104 εμφανίσεις

CS2034 TCP/IP DESIGN AND IMPLEMENTATION



L T P C

3 0 0 3


UNIT I

INTRODUCTION






9

Internetworking concepts and architecture model


classful Internet address


CIDR


Subnetting and Supernetting


AARP


RARP
-

IP
-

IP Routing


ICMP


IPV6.


UNIT II

TCP








9

Services


header


connection establishment and termination


interactive data flow


bulk data flow


timeout and retransmission


persist timer


keep alive timer


futures

and performance.


UNIT III


IP IMPLEMENTATION





9

IP global sof
tware organization


routing table


routing algorithms


fragmentation and

reassembly


error processing (ICMP)


Multicast Processing (IGMP).


UNIT IV

TCP IMPLEMENTATION I





9

Data structure and input processing


transmission control blocks


segmen
t format


comparision


finite state machine implementation


Output processing


mutual

exclusion


computing the TCP Data length.


UNIT V

TCP IMPLEMENTATION II




9

Timers


events and messages


timer process


deleting and inserting timer event


fl
ow control and adaptive retransmission


congestion avoidance and control


urgent

data processing and push function.


TOTAL: 45 PERIODS


TEXT BOOKS:

1. Douglas E Comer,”Internetworking with TCP/IP Principles,Protocols and

Architecture”,Vol 1 and 2, Vth Ed
ition

2. W.Richard Stevans “TCP/IP Illustrated” Vol 1.2003.


REFERENCES:

1. Forouzan, “ TCP/IP Protocol Suite” Second Edition, Tate MC Graw Hill, 2003.

2. W.Richard Stevens “TCP/IP Illustrated” Volume 2, Pearson Education 2003













Saraswathi Velu C
ollege of Engineering

Dept. of CSE


Question with Answers


Sub Code / Title: CS 2034


TCP / IP Design and Implementation

Year / Sem


: IV / VII


Unit I


Introduction


Part A


1. Define networking, internetworking?

Networking


Interconnecting the indivi
dual host.

Internetworking


Interconnecting the different networks.


2. Define MAC address, IP address?

MAC address


is the
physical address of a host
. Its length is 48 bits.
Eg:12:de:34:0f:1x:1d

IP address


is the logical address of a host. Its length
is 32 bits. Eg:191.168.150.1


3.
How we can identify a host.


A host can be identified by its logical address (IP) and physical address(MAC).


4. Define Classfull and Classless addressing?

Classful addressing


Total address space is divided in to 5 classe
s called as Class ‘A’,
Class ‘B’, Class ‘C’, Class’D’ and Class’E’ such that each class with their own prefix.

Classless addressing


Here, there are variable length blocks that belong to no class. The
entire address space is divided in to blocks based on
organization needs.


5.
What is subnetting ?

Subnetting divides one large network into several smaller ones. Subnetting adds an
intermediate level of hierarchy in IP addressing.


6. What is supernetting?

Supernetting combines several networks
into one large one.


7
. What is meant by masking ?

Masking is a process that extracts the network address from an IP address. Subnet
masking is a process that extracts the subnetwork address from an IP address. A network
or subnet address is obtained fro
m applying the bit
-
wise AND operation on the IP address
and the mask.


8
. What is meant by connectionless protocol?

The IP protocol is a connectionless protocol. Every packet is independent and has
no relationship to any other packet.

9
. Wh
at is direct delivery?

The delivery of a packet is called direct if the deliverer (host or router) and the
destination are on the same network.


10
. What is indirect delivery ?

The delivery of a packet is called indirect if the deliverer (host or router
) and the
destination are on different networks


11
. What is the function of routing table?

Every host or router has a routing table to route IP packets. In next hop routing instead of
a complete list of the stops the packet must make only the address of

the next hop is listed
in the routing table. In network specific routing all hosts on a network share one entry in
the routing table. In hostspecific routing the full IP address of a host is given in the
routing table. In default routing, a router is assi
gned to receive all packets with no match
in the routing table.


12
. What is static and dynamic routing ?

A static routing table’s entries are updated manually by an administrator. A dynamic
routing table’s entries are updated automatically by a routing
protocol.


13
. What are the fields included in routing table?

The routing table can consist of seven fields: a mask, a destination address, a next
-
hop
address, flags, a reference count, a use, and an interface. The routing module applies the
mask, row by

row, to the received destination address until a match is found. Classless
addressing requires hierarchical and geographical routing to prevent immense routing
tables.


14
. What is the maximum length of a datagram?

The maximum length of a datagram is 65
,535 bytes.


15
. What is Maximum Transfer Unit ?

The MTU is the maximum number of bytes that a data link protocol can encapsulate.
MTUs

vary from protocol to protocol.


16
. What is Fragmentation?

Fragmentation is the division of a datagram into smaller uni
ts to accommodate the MTU
of adata link protocol. The fields in the IP header that relate to fragmentation are the
identification number,

the fragmentation flags, and the fragmentation offset. The IP
datagram header consists of a fixed, 20
-
byte section and

a variable options section with a
maximum of 40 bytes.


17
. How the errors are detected in IP?

The error detection method used by IP is the checksum. The checksum uses one’s
complement

arithmetic to add equal
-
size sections of the IP header. The complement
ed
result is stored in the

checksum field. The receiver also uses one’s complement arithmetic
to check the header.


18.

What is Unicast, Multicast and Broad cast communication?

Unicast communication is one source sending a packet to one destination. Multic
ast

communication is one source sending a packet to multiple destinations. Hosts with the
same multicast

address can either be on the same network or on different networks.
Multicast addresses are often used

for information retrieval and conferencing purpo
ses.
Broadcast communication is one source sending a

packet to all hosts on its network


19. Differentiate ARP and RARP?

ARP


Address Resolution Protocol, which translates the given 32
-
bit IP address in to
48
-
bit MAC address.

RARP


Reverse Address Resol
ution Protocol, which translates the given 48
-
bit MAC
address into 32
-
bit IP address.


20. Draw the IPv6 packet format.

+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+

|Version| Prio. | Flow Label |

+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+

| Payload Length | Next Header | Hop Limit |

+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+

|

|

| |

+ Source Address +

+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+

|

|

| |

+ Destination Address +

| |

+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+


21. What is the necessity for having ‘ttl’ field.

ttl


refers to time to live and this field will say the validity / lifetime for a IP datagram.


22. What is the importance of ICMP?

Internet Control Message Protocol


used to r
eport the errors that had occurred while
forwarding the IP datagram to the original sender of the datagram.

Eg: Destination unreachable, Redirection etc.













Unit II


TCP


Part A

1. List out various TCP services?


* Connection Oriented


* Reliable


* 8 bit byte stream.


2. Draw the TCP header format?

Bit
offse
t


0


1


2


3


4


5


6


7


8


9

1
0

1
1

1
2

1
3

1
4

1
5

1
6

1
7

1
8

1
9

2
0

2
1

2
2

2
3

2
4

2
5

2
6

2
7

2
8

2
9

3
0

3
1

0

Source port

Destination port

32

Sequence number

64

Acknowledgment number (if
ACK

set)

96

Data
offset

Reserve
d

N

S

C

W

R

E

C

E

U

R

G

A

C

K

P

S

H

R

S

T

S

Y

N

F

I

N

Window Size

128

Checksum

Urgent pointer (if
URG

set)

160

...

Options (if Data Offset > 5)

...

padding


3. Describe the protocol used for connection establishment.

Three way handsha
king protocol is used for connection establishment:

a.

SYN
: The active open is performed by the client sending a SYN to the server. It
sets the segment's sequence number to a random value A.

b.

SYN
-
ACK
: In response, the server replies with a SYN
-
ACK. The
acknow
ledgment number is set to one more than the received sequence number
(A + 1), and the sequence number that the server chooses for the packet is another
random number, B.

c.

ACK
: Finally, the client sends an ACK back to the server. The sequence number
is set
to the received acknowledgement value i.e. A + 1, and the
acknowledgement number is set to one more than the received sequence number
i.e. B + 1.


4. Define interactive data flow and bulk data flow.

On a byte
-
count basis the ratio is around 90% bulk data
and 10% interactive,
since bulk data segments tend to be full sized (normally 512 bytes of user data), while
interactive data tends to be much smaller. (The above
-
mentioned study found that 90% of
Telnet and Rlogin packets carry less than 10 bytes of user
data.).


5. Define retransmission. When it occurs?


Whenever a segment has been transmitted, a retransmission timer will scheduled
with RTO value. If no ACK was received till the timer expires then, the same segment
has to be retransmitted.


6. Define Keep
alive timer.

In order to understand what TCP keepalive (which we will just call keepalive)
does, you need do nothing more than read the name: keep TCP alive. This means that you
will be able to check your connected socket (also known as TCP sockets), and d
etermine
whether the connection is still up and running or if it has broken.


7. What is Persist timer?

If an acknowledgment is lost, we could end up with both sides waiting for the
other: the receiver waiting to receive data (since it provided the sender
with a nonzero
window) and the sender waiting to receive the window update allowing it to send. To
prevent this form of deadlock from occurring the sender uses a
persist timer

that causes it
to query the receiver periodically, to find out if the window has

been increased. These
segments from the sender are called
window probes.


8. Explain TCP connection termination process?

TCP Connection Termination is implemented as follows:

1.

One computer sends a FIN packet to the other computer including an ACK for the
last data received (N).

2.

The other computer sends an ACK number of N+1

3.

It also sends a FIN with the sequence number of X.

4.

The originating computer sends a packet with an ACK number of N+1. The
connection is closed.

Another way to close the connection is

for one computer to send a packet with the RST
(reset) bit set which will tell the other computer to immediately terminate the connection.


9. Define MSS?

The maximum segment size (MSS) is the largest "chunk" of data that TCP will
send to the other end.


10. Define half close.

TCP provides the ability for one end of a connection to terminate its output, while
still receiving data from the other end. This is called a
half
-
close


11. What is reset segment.

We've mentioned a bit in the TCP header named RST f
or "reset." In general, a
reset is sent by TCP whenever a segment arrives that doesn't appear correct for the
referenced connection


12. Define simultaneous open.

It is possible, although improbable, for two applications to both perform an active
open to e
ach other at the same time. Each end must transmit a SYN, and the SYNs must
pass each other on the network. It also requires each end to have a local port number that
is well known to the other end. This is called a
simultaneous open.






Unit III


IP Im
plementation

Part A

1. Describe about ‘ipproc
.c’


ipproc.c


IP process, which is responsible to extract a datagram from a queue and
to process it ie., to forward towards destination.


2. How the IP software is designed.


IP software is designed by conside
ring the followings:



Uniform Routing & Queue



Independent Process



Pseudo network interface queue


3.
Define the term “directed broadcast”


Whenever a datagram is sent to a directed broadcast address, all machines on the
specified network must receive a copy
. It includes both the gateway and host on the
destination network. The gateway will perform the following:



Make a copy of the datagram for protocol software



Broadcast the datagram


4.
List out the fields available in routing table data structure?


Struct
‘route’ contains following fields.



Ipaddr rt_net


network address of the route



Ipaddr rt_mask


mask address for this route



Ipaddr rt_gw


next hop address



U_short rt_metri


distance metric



U_short rt_ifnum


Interface number



Short rt_ttl


time to live

in seconds.


5.
What is purpose the ‘don’t fragment’ and ‘most fragment’ bit?


DF ( don’t fragment)


indicates whether fragmentation can be done or not. If it is
set, then the datagram should not be fragmented else fragmentation can be done if
needed.


M
F ( more fragment)


indicates whether it is the last or some are fragments are
there. If set, then there are some more fragments yet to be received else, it is the last
fragment of the datagram.


6.
Define the term “fragment fragmentation”


If the path i
nvolves more than one gateway/ router, then this may happen. That is
if one gateway fragments the original datagram, the fragments themselves may be too
large for the subsequent network along the path. Thus, gateway may receive fragments
that it must frag
ment into even smaller pieces.


7.
Differentiate ‘datagram fragmentation’ and ‘fragment fragmentation’


The distinction between datagram fragmentation and fragment fragmentation
arises from the way a gateway handle the more fragments bit. For the datagram
fragmentation the MF bit is assigned ‘0’ only for the final fragment, but for the fragment
fragmentation the MF bit is assigned ‘0’ only for the last fragment of the final fragment.


8.
How the ‘fragment offset’ field will help.


Fragment offset in conside
red while we join all the fragments so as to make the
original datagram. Based on this offset value the fragments will be arranged and the
datagram will be constructed.


9.
Define ‘ip_anyaddr’



It is a address whose all 32 bits are 0’s. It will be filled
as source address if the
gateway is unable to find the source address.


10.
When an ICMP error can be generated?


If the gateway is unable to forward / deliver the datagram to destination, then an
ICMP error(appropriate type error message) to indicate the
same can be generated and
sent back to original source of the datagram.


11.
When no ICMP errors should be generated?


Gateway should never generate an error message



About an error message



For any fragment other than first



For broadcast or multicast datagr
ams


12.
Define host group.


The set of all hosts associated with a given multicast address. Host group
membership is dynamic


ie, host can join or leave from a group at any instance.


13.
What are types of IGMP message?


There are two types as follows.



Q
uery


used to make a request / query regarding membership



Report


used to report the membership for the query received.


14.
What do you mean by configuring the network hardware for a multicast address?


Configuring the network interface means that makin
g the hardware to
accommodate multicast transmission and reception.


Unit IV


TCP Implementation


I


Part A


1.
What is the datastructure used by TCP?


Transmission Control blocks (TCB) is the datastructure used to store all the
information’s about the T
CP connections which includes addresses, port numbers of
connection endpoints etc.


2.
How TCP software is implemented.


TCP implementation contains three process.



One process to handle incoming segments



One process to manage outgoing segments



A timer proc
ess that manages delayed event and retransmission timeouts.


3.
When a TCB should be allocated and deallocated.


TCB should be allocated whenever TCP establishes a connection. And TCB
should be deallocated whenever a connection terminates.


4.
Define grace
ful shutdown.


TCP uses modified 3
-
way handshake to shut down connections.


5.
What do you mean by aborting the connection?


Whenever unwanted segments like reset or syn arrives in synchronized states, the
TCP calls “tcpabort” to abort the connection ie.,
to deallocate the TCB.


6.
List out the synchronized states in TCP FSM?


Synchronized states


ESTABLISHED, FINWAIT1,FINWAIT2, CLOSE WAIT,
LAST ACK, SYNRCVD


7.
What are the TCP output message types.



Send


sen dat and/or ack



Persist


send probe to test r
eceiver’s zero window



Retransmit


retransmit a segment



Delete


delete a TCB that has expired


8.
Define Initial Sequence Number?


The Tcp code must choose a unique starting sequence number each time an
application attempts to create a new connection. And

this initial sequence number is
generated by using the current time
-
of
-
day clock.


9. What is the need of timed delay after closing a TCP connection?


TCP allows immediate reuse of port numbers after the connection is terminated.
So, if any duplicated FIN

request from previous connection is received, then it will cause
the termination. So, to avoid this TCP doesn’t delete TCB immediately after a
connection termination.



Unit IV


TCP Implementation


I
I


Part A


1. What is the datastructure used to store

timer events.


Delta list


data structure is used to store the delay requests. Each item in delta list
corresponds to an event scheduled to occur in future.


Each entry has two fields


one is the relative time (indicating when event should
occur) and on
e field to point the next entry


2. What are the different timers used by TCP?

Retransmission & timeout timer, keepalive timer, persist timer and time_wait
timer(2MSL timer).


3. Describe ‘tcpkilltimer’


It is procedure used to delete all the pending event
s associated with the TCB. It
will be called when TCB has to deleted.


4. List down the possible ways by which TCP adaptive retransmission can be tuned.


Retransmission timer & backoff, window based flow control, MSS computation,
congestion avoidance & co
ntrol, round trip estimation.


5.Define ‘cumulative ack’


Here each ACK carry the sequence number which specifies how many
contiguous octets of data is received.


6. Describe the field ‘tcb_rexmtcount’


This field records the counts of retransmission. And

this count should not exceed
the maximum retries value.


7. Define Silly window syndrome.


If a receiver advertises buffer space as soon as it becomes available (ie, free), then
it is called as silly window syndrome. To avoid this, TCP uses a technique ca
lled as
receiver side silly window avoidance.


8. What is impact of congestion?


Congestion will cause TCP to retransmit the segments, increasing delay etc. It can
be avoid by adopting ‘multiplicative decrease’ and ‘slow start’ techniques.


9. Define urgen
t data.


Urgent data refers to that the data has to delivered to application which runs on
the endpoint as soon as the segment had arrived.


10. What the field urgent pointer contains?


Urgent pointer will contain the next byte of the end of urgent data in

a segment.


11. What is push request?


It request the TCP to send the all existing data without delay.. When TCP sends it
sets the PUSH bit in the segment code field.






UNIT I


INTRODUCTION


PART B


1.

Explain in detail about the ARP and RARP protocols wi
th neat sketch.


(16)

2.

Explain In detail about classfull and classless addressing techniques.


(16)

3.

Explain about subnetting and supernetting in detail.




(16)

4.

Explain about ICMP.








(12)

5.

Discuss in detail about IP Routing.






(16)



UNIT II

TCP


PAR
T B


1.

Explain in detail about the connection establishment and connection termination
process.(16)

2.

Explain about Keepalive timer and its importance.




(16)

3.

Sketch out the necessities of persist timer in detail.




(16)

4.

Write in detail about timeout and re
transmission of data packets.



(16)

5.

Explain about interactive data flow.






(16)



PART B


1.

Describe about IP global software in detail.





(16)

2.

Explain about IP Routing in detail.






(16)

3.

Explain about fragmentation and reassembly in detail.




(16)

4.

Describe about IGMP








(16)

5.

Describe about ICMP error processing.






(16)



UNIT

IV

TCP IMPLEMENTATION I


PART B


1.

Explain with sketch about finite state machine implementation of input processing. (16)

2.

Explain about Output processing.






(12)

3.

Write

in detail about process “tcphowmuch”.





(12)

4.

Explain about data structures used for input processing




(10)








UNIT

V

TCP IMPLEMENTATION II



PART B


1.

Explain about the “timer.h” process. How a timer event can be inserted and deleted.(16)

2.

Explain in

detail about flow control and adaptive retransmission in TCP.



(16)

3.

Explain about Congestion control and avoidance in TCP.




(16)

4.

Describe about how to process a urgent data in TCP.




(16)

5.

Write the codings for implementation of push function.




(16)