TCP / IP DESIGN AND IMPLEMENTATION Two Marks Questions With Answers 2014
CS 2034 – TCP / IP DESIGN AND IMPLEMENTATION
Unit I – Introduction
1. Define networking, internetworking?
Networking – Interconnecting the individual 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:188.8.131.52
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 classes 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 from 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. What 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 assigned 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 units 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 complemented 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. Multicast 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 purposes. 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 Resolution Protocol, which translates the given 48-bit MAC
address into 32-bit IP address.
20. Draw the IPv6 packet format.
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
22. What is the importance of ICMP?
Internet Control Message Protocol – used to report the errors that had occurred while forwarding the IP datagram to the original sender of the datagram.
Eg: Destination unreachable, Redirection etc.
1. List out various TCP services?
* Connection Oriented
* 8 bit byte stream.
2. Draw the TCP header format?
Unit II– TCP
3. Describe the protocol used for connection establishment.
Three way handshaking 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 acknowledgment 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 Keepalive 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 determine 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 for "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 each 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 Implementation
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 considering the followings:
Uniform Routing & Queue
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.
MF ( 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 involves 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 fragment 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 considered 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 datagrams
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.
Query – 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 making the hardware to accommodate multicast transmission and reception.
Unit IV – TCP Implementation – I
1. What is the datastructure used by TCP?
Transmission Control blocks (TCB) is the datastructure used to store all the information’s about the TCP 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 process 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 graceful 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 receiver’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 V – TCP Implementation – II
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 one 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 events 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 & control, 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 called 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 urgent 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.