Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Part One Complete the following short answer questions about networking concepts

ID: 666793 • Letter: P

Question

Part One

Complete the following short answer questions about networking concepts. (20 points)

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

duplex service?

Q1.2 What are the differences between TCP connections and UDP connections? Why is DNS run over UDP?

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

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

Part Two

Solve the following network problems, and show your work. (80 points)

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.

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

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

sum?

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

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.)

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. (Hint: The FSM for C and D should be essentially the same as for B.) Also, give a description of the packet format(s) used.

Explanation / Answer

Q1.2

          Ans:

Difference between TCP and UDP

TCP

UDP

Reliability: TCP is connection-oriented protocol. When a file or message send it will get delivered unless connections fails. If connection lost, the server will request the lost part. There is no corruption while transferring a message.

Reliability: UDP is connectionless protocol. When you a send a data or message, you don't know if it'll get there, it could get lost on the way. There may be corruption while transferring a message.

Ordered: If you send two messages along a connection, one after the other, you know the first message will get there first. You don't have to worry about data arriving in the wrong order.

Ordered: If you send two messages out, you don't know what order they'll arrive in i.e. no ordered

Heavyweight: - when the low level parts of the TCP "stream" arrive in the wrong order, resend requests have to be sent, and all the out of sequence parts have to be put back together, so requires a bit of work to piece together.

Lightweight: No ordering of messages, no tracking connections, etc. It's just fire and forget! This means it's a lot quicker, and the network card / OS have to do very little work to translate the data back from the packets.

Streaming: Data is read as a "stream," with nothing distinguishing where one packet ends and another begins. There may be multiple packets per read call.

Datagrams: Packets are sent individually and are guaranteed to be whole if they arrive. One packet per one read call.

Examples: World Wide Web (Apache TCP port 80), e-mail (SMTP TCP port 25 Postfix MTA), File Transfer Protocol (FTP port 21) and Secure Shell (OpenSSH port 22) etc.

Examples: Domain Name System (DNS UDP port 53), streaming media applications such as IPTV or movies, Voice over IP (VoIP), Trivial File Transfer Protocol (TFTP) and online multiplayer games etc

Q2.1

          Ans:

Sum of 1st two bytes:

01010101

01110000

_______

11000101

Adding 3rd byte to the sum:

11000101

01001100

________

100010001

Sum is 00010001

1s complement of sum: 11101110

UDP takes the complement instead of the sum because when the numbers are added all together including the checksum, it makes the number all ones and is used to identify errors.

Using this, the receiver detects the error by observing the sum of all the three bytes and the checksum. If it is all 1s then it is considered that there are no errors.

It is possible to detect the 1 bit errors. They cannot go undetected. But two bit errors cannot be detected because the sum remains same when two bits are flipped.

TCP

UDP

Reliability: TCP is connection-oriented protocol. When a file or message send it will get delivered unless connections fails. If connection lost, the server will request the lost part. There is no corruption while transferring a message.

Reliability: UDP is connectionless protocol. When you a send a data or message, you don't know if it'll get there, it could get lost on the way. There may be corruption while transferring a message.

Ordered: If you send two messages along a connection, one after the other, you know the first message will get there first. You don't have to worry about data arriving in the wrong order.

Ordered: If you send two messages out, you don't know what order they'll arrive in i.e. no ordered

Heavyweight: - when the low level parts of the TCP "stream" arrive in the wrong order, resend requests have to be sent, and all the out of sequence parts have to be put back together, so requires a bit of work to piece together.

Lightweight: No ordering of messages, no tracking connections, etc. It's just fire and forget! This means it's a lot quicker, and the network card / OS have to do very little work to translate the data back from the packets.

Streaming: Data is read as a "stream," with nothing distinguishing where one packet ends and another begins. There may be multiple packets per read call.

Datagrams: Packets are sent individually and are guaranteed to be whole if they arrive. One packet per one read call.

Examples: World Wide Web (Apache TCP port 80), e-mail (SMTP TCP port 25 Postfix MTA), File Transfer Protocol (FTP port 21) and Secure Shell (OpenSSH port 22) etc.

Examples: Domain Name System (DNS UDP port 53), streaming media applications such as IPTV or movies, Voice over IP (VoIP), Trivial File Transfer Protocol (TFTP) and online multiplayer games etc