The Best Networking and Encryption Quiz Questions (Part 1)


Q1.1 What are the main features of TCP connections? Why is it said that TCP provides fullduplex service?

It is the obligation of TCP to pack this byte stream to packets, known as TCP sections, which are gone to the IP layer for transmission to the destination gadget. With a specific end goal to give reliability, TCP must recuperate from data that is harmed, lost, copied, or conveyed out of request by the Network Layer. Multitasking accomplished using port numbers in TCP.

A TCP connection gives a full-duplex functionality that implies TCP accommodates simultaneous data streams in both headings. On the off chance that there is a TCP connection between Process An on one host and Process B on another host, then application layer data can flow from Process A to Process B in the meantime as application layer data flows from Process B to Process A.
Q1.2 What are the differences between TCP connections and UDP connections? Why is DNS run over UDP?

UDP is connectionless protocol. When you a send a data or message, you don’t know whether it’ll arrive, it could get lost in transit. TCP is connection-situated protocol. At the point when a record or message send it will get conveyed unless connections falls flat. On the off chance that connection lost, the server will ask for the lost part. There is no defilement while exchanging a message.

In UDP there is no ordering of messages, no following connections, and so forth. Though in TCP, on the off chance that you send two messages along a connection, consistently, you know the primary message will arrive first.

In UDP Packets are sent independently and are ensured to be entire on the off chance that they arrive. One packet for each one read call. While in TCP Data is perused as a “stream,” with nothing recognizing where one packet closes and another starts. There might be numerous packets per read call.

In specific circumstances UDP is utilized on the grounds that it permits broadcast packet transmission. This is now and then key in cases such as DHCP protocol, in light of the fact that the customer machine hasn’t in any case gotten an IP address and there won’t be any approach to build up a TCP stream without the IP address itself.

The DNS protocol itself is intended to be a basic, little protocol. UDP is basic, quick, and sensible solid. DNS is sufficiently basic that a basic stateless protocol like UDP is more qualified than TCP. The special case is the point at which the answer is truly extensive.

Q1.3 TCP creates a reliable data transfer service, in addition to IP’s unreliable best-effort service. Study the related sections of the text, and in your own words, summarize how TCP provides a reliable data transfer service.

TCP is a reliable data exchange protocol that is actualized on top of an unreliable (IP) end-end network layer. All the more by and large, the layer underneath the two dependably imparting endpoints may comprise of a solitary physical connection e.g., as on account of a connection level data exchange protocol or a worldwide between network e.g., as on account of a transport-level protocol. For our reasons, nonetheless, we can see this lower layer just as an unreliable point-to-point channel. For connection-arranged administration gave by TCP, it is important to have a reliable data transfer (RDT) protocol to guarantee conveyance of all packets and to empower the recipient to convey the packets with a specific end goal to its application layer. TCP gives a correspondence channel between processes on every host system. The channel is reliable, full-duplex, and streaming. To accomplish this usefulness, the TCP drivers separate the session data stream into discrete segments, and connect a TCP header to every segment. An IP header is joined to this TCP packet, and the composite packet is then gone to the network for conveyance. This TCP header has various fields that are utilized to support the planned TCP usefulness.

Q1.4 What is three-way handshake? Draw a diagram showing how a TCP connection is established through three-way handshake

The TCP three-way handshake in Transmission Control Protocol (otherwise known as SYN-SYN-ACK) is the technique utilized by TCP set up a TCP/IP connection over an Internet Protocol based network. TCP’s three way handshaking method is regularly alluded to as “SYN-SYN-ACK” on the grounds that there are three messages transmitted by TCP to arrange and begin a TCP session between two PCs. The TCP handshaking component is planned so that two PCs endeavoring to impart can arrange the parameters of the network TCP attachment connection before transmitting data, for example, SSH and HTTP web browser demands.

This 3-way handshake process is likewise composed so that both closures can start and arrange separate TCP attachment connections in the meantime. Having the capacity to arrange various TCP attachment connections in both bearings in the meantime permits a solitary physical network interface, for example, Ethernet, to be multiplexed to exchange different streams of TCP data at the same time.

three way handshake

Q2.1 UDP and TCP use the 1s complement for their check sums. Suppose you have the following three 8-bit bytes: 10011001, 01010010, and 01011001.

  1. What is the 1s complement of the sum of these 8-bit bytes? Show all your work.

1 0 0 1 1 0 0 1

+ 0 1 0 1 0 0 1 0

1 1 1 0 1 1 1 1


1 0 0 1 1 0 0 1

+ 0 1 0 1 1 0 0 1

1 1 1 1 0 0 1 0

One’s compliment: 1 1 1 0 1 1 1 1

  1. Why UDP takes the 1’s complement of the sum; that is, why not just use the sum?

In the event that the sum contains a zero, the receiver knows there has been an error.

  1. With the 1s complement scheme, how does the receiver detect errors?

To distinguish errors, the recipient includes the four words i.e. the three unique words and the checksum. On the off chance that the sum contains a zero, the recipient knows there has been a blunder.

  1. Is it possible that a 1-bit error will go undetected? How about a 2-bit error? (Note that although UDP and TCP use 16-bit words to compute the checksum, for this problem you are being asked to consider 8-bit summands.)

Each of the one-piece errors will be distinguished, however two-bit errors can be undetected e.g., if the last digit of the primary word is changed over to a 0 and the last digit of the second word is changed over to a 1.

Q2.2 Consider a scenario in which a Host, A, wants to simultaneously send messages to Hosts B, C, and D. A is connected to B, C, and D via a broadcast channel, and a packet sent by A is carried by this channel to each of B, C, and D. Suppose that the broadcast channel connecting A, B, C, and D can independently lose and corrupt messages (and so, for example, a message sent from A might be correctly received by B, but not by C and D).

Design a stop-and-wait-like error-control protocol for reliably transferring a packet from A to B, C, and D, such that A will not get new data from the upper layer until it knows that B, C, and D have correctly received the current packet. Give FSM descriptions of A and B.


Q2.3. The following table is used to compute the shortest path from A to all other nodes in a network, according to link-state algorithm.
By, Using Dijkstra’s algorithm we begin with U. In the initial step, the as of now known least-cost paths from u to its straightforwardly joined neighbors, v, x, and w, are introduced to 2, 5 and 1, separately. The cost to w is set to 5 (despite the fact that we will soon see that a lesser-cost path does to be sure exist) since this is the cost of the immediate connection from u to w. The costs to y and z are set to boundlessness since they are not specifically associated with u. In the principal cycle, we look among those nodes not yet added to the set N and find that node with the least cost as of the end of the past emphasis. That node is x, with a cost of 1, and along these lines x is added to the set N. In the second cycle, nodes v and y are found to have the least-cost paths, and we break the tie discretionarily and add y to the set N so that N now contains u, x, and y. The cost to the remaining nodes not yet in N, that is, nodes v, w, and z are updated.

b. Consider the following network. With the indicated link costs, use Dijkstra’s shortest path algorithm to compute the shortest path from x to all network nodes. Show how the algorithm works by computing a table similar to the table above.

Step   N’ D(t),












D(s), p(s)
0 x 2,x 1,x 5,x
1 Xu 11,x 2,x 3,x 1,x 3,x
2 Xuv 5,x 2,x 3,x 1,x 3,x 8,x
3 Xuvw 5,x 2,x 3,x 1,x 3,x 8,x
4 xuvwy 5,x 2,x 3,x 1,x 3,x 4,x 8,x
5 Xuvwyt 5,x 2,x 3,x 1,x 3,x 4,x 8,x
6 Xuvwyts 5,x 2,x 3,x 1,x 3,x 4,x 8,x
7 Xuvwytsz 5,x 2,x 3,x 1,x 3,x 4,x 8,x


Q2.4. A router has the following (CIDR) entries in its routing table: Address/mask Next hop Interface 0 Interface 1 Router 1 Default Router 2 For each of the following IP addresses, what does the router do if a packet with that address arrives?


Taking the initial 22 bits of as network address, we take It coordinates the network address of the second row. The packet will be sent to Interface 1.


Taking the initial 22 bits of the above IP address as network address, we have It coordinates the network address of the primary column. The packet will be sent to Interface 0.


Taking the initial 22 bits of the above IP address as network address, we have It doesn’t coordinate the network addresses of the initial three columns. The packet will be sent to default gateway portal which is Router 2.


Taking the initial 23 bits of the above IP address as network address, we have It coordinates the network address of the third column. The packet will be sent to Router 1.


Taking the initial 23 bits of the above IP address as network address, we have It doesn’t coordinate the network addresses of the initial three columns. The packet will be sent to default entryway which is Router 2.

Q2.5. For a 1-Gbps network operating over 5000 km, the delay is the limiting factor, not the bandwidth. Consider a MAN with the average source and destination 20 km apart. At what data rate does the round-trip delay due to the speed of light equal the transmission delay for a 1-KB packet? Assume the speed of light in fiber to be 2/3 the speed of light in a vacuum.

1Gbps network working over 5000km

Average source and destination 20km

What is the data rate =?

Packet size = 1KB

Assume Speed of light = 6μs/km

Propagation delay for 5000km is =

Maximum packet size = 1024 * 8 = 8192 Kbits

Data rate =  = 136.533 kbps


Please enter your comment!
Please enter your name here