in the second segment sent from host a to b what are the sequence numbers

Computer Systems

Tutorial 5: TCP + git

Tutorial Week 5

Transport Layer: TCP (plus git)

1. Consider a TCP connection betwixt Host A and Host B. Suppose that the TCP segments traveling from Host A to Host B accept source port number x and destination port number y. What are the source and destination port numbers for the segments traveling from Host B to Host A?

  • source port number: y
  • destination port number: x

2. Suppose that a Web server runs in Host C on port fourscore. Suppose this Web server uses persistent connections, and is currently receiving requests from ii different Hosts, A and B. Are all of the requests being sent through the same socket at Host C? If they are being passed through different sockets, exercise both of the sockets have port 80? Discuss and explain.

They apply different sockets. For a persistent connection the web server
listens on port 80, and then spawns a new socket with a unlike port number Typically the web server will have a unmarried process with a thread for each connectedness socket, or could use separate processes with private sockets.

StackOverflow: How multiple clients connect to port eighty

http_tcp_connection

three. A negative acknowledgement tells the sender that a item packet has not been received, rather than that a packet has been received. Consider a reliable data transfer protocol that uses only negative acknowledgments. Suppose the sender sends data but infrequently. Would a NAK-only pro- tocol exist preferable to a protocol that uses ACKs? Why? Now suppose the sender has a lot of information to send and the end-to-end connection experiences few losses. In this 2d instance, would a NAK-only protocol be preferable to a protocol that uses ACKs? Why?

  • NAK only: Would not be preferable; if there was a single segment sent, the receiver would be unaware they had missing data until the next segment was received and then there would exist a substantial delay in recovery
  • Second example: NAK-simply would have much less overhead because there only needs to be a NAK for a lost packet, and the response time would be brusk because lots of data is beingness transmitted

4. Suppose Host A sends ii TCP segments back to back to Host B over a TCP connectedness. The showtime segment has sequence number 900; the 2nd has sequence number 1024.

(a) How much information is in the start segment?

information: 1024-900=124 bytes

(b) Suppose the offset segment is lost just the 2nd segment arrives at B. In the acknowledgement that Host B sends to Host A, what will be the acknowledgement number?

900

(c) Suppose that now the third segment with sequence number of 1124 from Host A arrives to Host B, and the second segment is still missing. What volition be the acknowledgement number?

1024

5. Host A and B are communicating over a TCP connectedness, and Host B has already received from A all bytes up through byte 126. Suppose Host A then sends two segments to Host B back-to-back. The get-go and 2d segments contain fourscore and twoscore bytes of data, respectively. In the first segment, the sequence number is 127, the source port number is 302, and the destination port number is 80. Host B sends an acquittance whenever it receives a segment from Host A.

(a) In the second segment sent from Host A to B, what are the sequence number, source port number, and destination port number?

sequence number: 127+80=207 source port number: 302 destination port number: lxxx

(b) If the first segment arrives before the 2nd segment, in the acknowl- edgment of the beginning arriving segment, what is the acknowledgment number, the source port number, and the destination port number?

ack. number: 207 source port number: 80 destination port number: 302

(c) If the second segment arrives before the first segment, in the acknowl- edgment of the first arriving segment, what is the acknowledgment number?

ack. number: 127

(d) Suppose the two segments sent by A go far in order at B. The first acknowledgment is lost and the second acknowledgment arrives after the beginning timeout interval. Draw a timing diagram, showing these segments and all other segments and acknowledgments sent. (As- sume there is no boosted packet loss.) For each segment in your figure, provide the sequence number and the number of bytes of data; for each acquittance that you add, provide the acquittance number.

![tutorial_5tcp_diagram](/notes/notebooks/comp_sys/img/tutorial_5_tcp_diagram.png) _6. A reliable information transfer should provide two guarantees:

  • the commitment of the packet, i.e., no parcel loss;
  • protection confronting adventitious errors, i.e., packets corrupted past ran- dom changes of $.25 volition not be delivered.

It does not guarantee in-guild delivery; we say "TCP provides reliable, in-society delivery" considering reliable does not imply in-society. What other notions of "reliability" are there, and at what layers are they provided?

  • tcp checksum is not robust: high probability of collisions; non standoff resistant
    • multiple payloads tin can generate the same checksum
    • adversary could interfere
    • mitigant: use digital signatures (cryptography); guarantees integrity
  • non clear if origin is accurate: need hallmark as well; provided with certificates
    • HTTPS
  • privacy: encryption via TLS (OSI model layer v); between transport layer/and application layer

7. Imagine y'all were going to reimplement git. What algorithm would you use to merge two sets of changes to a text file? Remember about how fast your scheme would be, and how accurate information technology would be.

stackoverflow: how does git merge piece of work?

  • find a merge base of operations, i.e. common ancestor of ii candidates
  • perform diffs of each candidate confronting the merge base
  • walk through diffs:
    • if both sides take the change, take information technology
    • if ane side has the alter, the other has no alter in that region, accept the change
    • if both sides have changes, marking a conflict for transmission resolution

pullenhatichoode.blogspot.com

Source: https://jsinkers.github.io/notes/notebooks/comp_sys/08_tutorial_5.html

0 Response to "in the second segment sent from host a to b what are the sequence numbers"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel