Networks Midterm 2

5.0(2)
Studied by 30 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/47

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 6:31 AM on 4/8/25
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No analytics yet

Send a link to your students to track their progress

48 Terms

1
New cards

What's the main function of the transport layer?

Process to Process communication (Data transfer)

2
New cards

Different services offered by transport layer?

Reliability, time, throughput, and security

3
New cards

Transport layer protocol names and their services (TCP and UDP services). What services are not available?

TCP: Congestion control, Flow control, Connection oriented, reliable transport (make sure in order)

UDP: Unreliable data transfer, •no-frills extension of “best-effort” IP

Services not available: 

  • delay guarantees

  • bandwidth guarantees

4
New cards

What are the transport layer services NOT provided by above protocol? (Like what's not provided with TCP and UDP)

TCP: Timing, throughput, Security

(TLS can provide security, as an add-on does not come with initially)

UDP: Reliability, Timing, Throughput, Security

5
New cards

How transport layer helps sender sending message to destination?

TCP client initiates connection with TCP server. Uses multiplexing, demultiplexing, and sockets to get message delivered. As well as TCP and UDP

6
New cards

If you are developing a new transport layer protocol, what are mandatory services you need to implement?

- Processor to Process communication (Is multiplexing/demultiplexing)

- Error checking

7
New cards

Explain multiplexing

- Done at the sender side

- Handles data from multiple sockets, puts into one stream, add transport header

(Is used later for demultiplexing)

8
New cards
<p>Explain De-multiplexing</p>

Explain De-multiplexing

- Done from the receiver

- Uses header info to deliver received to the correct segments

- Host receives IP datagrams

  • Each datagram has source and destination IP address

  • Each datagram also carry one transport-layer segment

  • Each segment has source and destination port number

- Host uses IP address and port numbers to direct segment to appropriate socket

- Revises with sockets/port numbers

9
New cards

Explain multiplexing, demultiplexing with help of socket

Multiplexing

- Takes data from multiple sockets, creates the header

Demultiplexing

- Uses header info to correct socket using IP address and port number

Both are in the transport and go through the network layer as well

IP tells it which device to send it to, port number determines which socket to go through

<p>Multiplexing</p><p>- Takes data from multiple sockets, creates the header</p><p></p><p>Demultiplexing</p><p>- Uses header info to correct socket using IP address and port number</p><p>Both are in the transport and go through the network layer as well</p><p>IP tells it which device to send it to, port number determines which socket to go through</p>
10
New cards

How client and server assign port number to the sockets

Port number:

  • 16 bit [0, 65535]

  • [0,1023] are well known port numbers 

    • HTTP: 80

    • FTP: 21

Server side:
The server assigns a specific, well-known port number to its socket. These port numbers are standardized and predefined for common services

Client side:
The client assigns a temporary (ephemeral) port number to its socket. This port number is usually chosen automatically by the operating system from a designated range of ephemeral ports. It’s used for the duration of the communication session.

11
New cards
<p>Connectionless demultiplexing</p>

Connectionless demultiplexing

Connectionless Demultiplexing:

  • UDP

  • IP/UDP datagrams with different source IP/port number but same destination it'll be received at same socket at receiving host

  • When creating socket, must specify host-local port #:

DatagramSocket mySocket1  = new DatagramSocket(12534);

  • Connectionless demultiplexing is when the UDP has each segment that is handled independently with no prior communication required (aka not connection oriented). For directing the segments to their proper processes, this would use the destination port number.

12
New cards

Connection oriented

Connection oriented demultiplexing:

  • Receivers uses all four values (4-tuple) Source/Destination IP and Source/Destination Port number

    • To direct segment to appropriate socket

  • TCP server has "welcoming socket" - waits for connection establishment (TCP client creates sockets and sends request to here)

  • When "Welcoming socket" receives the request and server creates new socket in response

  • Newly created connection socket is identified by 4 values (source and destination's IP addresses and port numbers)

• Subsequent request/response is handled by the new socket

13
New cards

What is Checksum

Goal: Verifying packet was sent without corruption

How does it work:

Sender

- converts data into binary, gets sum of that and does 1's compliment

- treat contents of UDP segment (including UDP header fields and IP addresses) as sequence of 16-bit integers

- If overflow, add one back in on least significant bit, then do 1’s compliment

Receiver

- compute checksum of received segment

- check if computed checksum equals checksum field value:

• not equal - error detected

equal - no error detected. But maybe errors nonetheless?

14
New cards

UDP -> Basic Functions

- Process to Process (unreliable)

- Error checking

15
New cards

UDP advantages?

  • no connection establishment (which can add RTT delay)

  • simple: no connection state at sender, receiver

  • small header size(TCP- 20 bytes UDP- 8 bytes)

  • no congestion control

    • UDP can blast away as fast as desired!

    • can function in the face of congestion

16
New cards

Why Simple Network Management Protocol (SNMP) uses UDP?

SNMP uses UDP because of the RTT (less than TCP) and UDP works against congestion while TCP can not (TCP throttles the user)

17
New cards

Why application using UDP still need to consider congestion control?

- UDP does not care and still sends data at highest rate

- Since receiver at max, packets getting sent will get lost

- Won't be able to have proper communication

18
New cards

How does UDP achieve error detection?

Checksum, by adding binary value of UDP segment (UDP header fields and IP address)

  • Sums all 16 bot words in the segment, overflow is wrapped around 

  • Performs 1’s complement

  • Puts it in the checksum field of the udp segment

- checksum field is 16 bit

19
New cards

Explain the problem, solution, and recovery for RDT 2.0, 2.1

RDT 2.0

ACK’s while sending data through first reliable channel (TCP), how do we know if packet is received

- Problem: Corrupted packets

- Solution: Packet checks checksum and if packet is in valid state…

ACK, NACK, checksum, retransmit

- Recovery: ARR (Automatic Repeat Request)

RDT 2.1

- Problem: RDT 2.0 + ACK/NACK corruption

- Solution: Add Checksum to ACK and the Sequence Number (Data) lets you know if the packet being sent is a duplicate

  • If corrupted, retransmit

- Recovery: Data

R(1) Duplicate pkt = send ACK again, S(1) Corrupted -> retransmit

20
New cards

Explain the problem, solution, and recovery for 2.2, and 3.0 (packet corrupted + packet loss)

RDT 2.2

Problem: NAK free protocol because of sequence number

Solution: On corruption, send ACK to which packet received properly

  • If duplicate at sender, retransmit

  • If sender sends 0 ACK and gets 0 ACK back, sender reads ACK 0 and sends 0 and repeats until it gets 1 ACK (ACKs are always 0 or 1 and is a cycle like 0, 1, 0, 1…)

Recovery: ACK with sequence, Duplicate ACK (sender) = Retransmit

RDT 3.0

Problem: Packet loss and Packet corruption

Solution:

  • To recover from packet loss, Timer (Timeout interval = RTT), retransmit

  • For corruption, still uses RDT 2.2

Recovery:

21
New cards

How to calculate sender utilization in stop and wait protocol RDT 3.0? What happens if you send more than one packet?

example: 1 Gbps link, 15 ms prop. delay, 8000 bit packet

U sender:

(L / R) / (L / R) + RTT

If you send more than one packet:

(N * L/R) / (L/R + Propagation delay (RTT))

Pipelining increases utilization by a factor of N Packets

Look at picture for some of example…

(0.008 s) / (0.008 s + [15 ms * 2]) => 0.008 / 30.008 => 0.00027

You multiply prop delay by 2 because it is RTT (ROUND TRIP TIME)

<p>U sender:</p><p>(L / R) / (L / R) + RTT</p><p></p><p>If you send more than one packet:</p><p>(N * L/R) / (L/R + Propagation delay (RTT))</p><p></p><p>Pipelining increases utilization by a factor of N Packets</p><p></p><p>Look at picture for some of example…</p><p></p><p>(0.008 s) / (0.008 s + [15 ms * 2]) =&gt; 0.008 / 30.008 =&gt; 0.00027</p><p><strong>You multiply prop delay by 2 because it is RTT (ROUND TRIP TIME)</strong></p>
22
New cards

Why pipelined protocols are natural next step from stop and wait?

Because with stop and wait, the sender has to wait for each packet to be responded by the receiver

- With pipelining, you can send multiple consecutive unACKed packets without needing to wait

23
New cards

What is window?

FOR GBN: A sender "window" of up to N consecutive transmitted but unACKed packets (DOES NOT HAVE BUFFER)

FOR SELECTIVE REPEAT: A sender “‘window” of up to N transmitted packets (DOES HAVE A BUFFER)

  • If window full: Can't send packets

If not full:

  • send packets

24
New cards
<p>Explain GBN sender</p>

Explain GBN sender

  • Sender sends N number of consecutive unACKed packets (that are within the window size)

  • ACK(n): ACKs all packets up to, including seq # n

  • When receiving ACK(n): move window forward to start at n + 1

  • Timer on for oldest in-flight packet

  • Timeout(n): retransmit packet n and all higher seq # packets in window

25
New cards

Explain GBN Receiver

ACK-only: always send ACK for correctly-received packet so far, with highest in-order seq #

  • • may generate duplicate ACKs

  • • need only remember rcv_base

on receipt of out-of-order packet:

  • • can discard (don’t buffer) or buffer: an implementation decision

  • • re-ACK pkt with highest in-order seq #

<p>ACK-only: always send ACK for correctly-received packet so far, with highest <em>in-order</em> seq #</p><ul><li><p>• may generate duplicate ACKs</p></li><li><p>• need only remember <span style="font-family: &quot;Courier New&quot;">rcv_base</span></p></li></ul><p></p><p>on receipt of out-of-order packet:</p><ul><li><p>• can discard (don’t buffer) or buffer: an implementation decision</p></li><li><p>• re-ACK pkt with highest in-order seq #</p></li></ul><p></p>
26
New cards

Explain Selective Repeat

The receiver individually ACKs all correctly received packets

  • Buffers packets (when needed) for in-order delivery to upper layer

Sender times-out/retransmits individually for unACKed packets

  • sender maintains timer for each unACKed packet

Send window

  • N seq #s

  • limts seq #s of sent, unACKed packets

<p>The receiver <strong><em>individually </em></strong>ACKs all correctly received packets</p><ul><li><p>Buffers packets (when needed) for in-order delivery to upper layer</p></li></ul><p>Sender times-out/retransmits individually for unACKed packets</p><ul><li><p>sender maintains timer for each unACKed packet</p></li></ul><p>Send window</p><ul><li><p>N seq #s</p></li><li><p>limts seq #s of sent, unACKed packets</p></li></ul><p></p>
27
New cards
<p>What happens on the sender side of Selective Repeat?</p>

What happens on the sender side of Selective Repeat?

data from above:

  • if next available seq # in window, send packet

timeout(n):

  • resend packet n, restart timer

ACK(n) in [sendbase,sendbase+N]:

  • mark packet n as received

  • if n smallest unACKed packet, advance window base to next unACKed seq #

28
New cards

What happens on the receiver side of Selective Repeat?

packet n in [rcvbase, rcvbase+N-1]

  • send ACK(n)

  • out-of-order: buffer

  • in-order: deliver (also deliver buffered, in-order packets), advance window to next not-yet-received packet

packet n in [rcvbase-N,rcvbase-1] (aka previous window)

  • ACK(n)… so it can get out of the retransmission loop

otherwise:

  • ignore

29
New cards

What is sequence number and it’s purpose?

A unique identifier for each packet to ensure that there is proper ordering and helps the receiver know when there is an out of order packet

30
New cards

What is the difference between Transport vs Network layer services and protocols?

Transport: logical communication between processes (relies on or enhances network layer services)

  • Houses = networks,

  • In the houses are people who can send letters: people are the process, letters = packets

Network: logical communication between hosts

  • postal service = network-layer protocol

  • Person who collects/distributes mail= multiplexing/demultiplexing

31
New cards

True or False: In sliding windows protocol GBN receiver must have a buffer.

Also is it better to have a buffer or not?

FALSE, receiver can discard (NOT buffer) or buffer based on implementation decision

It is BETTER to have a buffer because it can store the out-of-order packets in the buffer and doesn’t need to retransmission

32
New cards

Differentiate: Cumulative ACK vs Selective ACK

Cumulative:

  • When receiver sends ACK, all previous packets up to and including N are received properly


Selective:

  • Only tells you N packet was received properly

33
New cards

Discuss problem of GBN

Problem: If ACK is not at all (not every packet received an ACK), retransmit all data packets

34
New cards

In SR, why is it necessary for SR receiver to send ACK back when packet received in [rbase - N, Rbase - 1]

If the previous packet does not get an ack then the timer will timeout on the sender side causing it to retransmit (which can potentially loop) eventually not allowing the window to move up

35
New cards

True or False: In SR, individual timer is used for every sent but unACK packet

True, sender starts timer when packet is sent

If the timer times out, then sender selectively retransmits that specific packet

36
New cards
<p>How does TCP determine the sequence number and ACKs</p>

How does TCP determine the sequence number and ACKs

Sequence #

  • Sequence # of first byte

  • Ex: File size = 500 k bytes, MSS = 1k bytes, Total segment = 500

    Seq # of first segment = 0, seq # of 2nd = 1000, seq # of 3rd = 2000…

  • DOES NOT always start at 0

ACKs

  • Seq # of next byte expected from other side

If data > 1, need to add data to seq to next response (look at image to understand more)

37
New cards

True/False

(1) The network's routers and switches are primarily responsible for implementing the functions of the Transport layer.

(2) UDP packet header has 8 bytes

(3) TCP packet header has 20 bytes

(1) False

(2) True, Destination and Source port and checksum and length of header are each 8 bits (total = 64 bits)

(3) True, 10 mandatory fields (source, destination, ack number, and others)

38
New cards

What is multiplexing and demultiplexing ?

–UDP

–TCP

–Differentiate : UDP demultiplexing and TCP demultiplexing

  • Multiplexing, demultiplexing: based on segment, datagram header field values

  • UDP: demultiplexing using destination port number (only)

  • TCP: demultiplexing using 4-tuple: source and destination IP addresses, and port numbers

  • Multiplexing/demultiplexing happen at all layers

39
New cards
<p><span>•Rdt 2.0: show state transitions for given situation. (check the assignment questions)</span></p>

•Rdt 2.0: show state transitions for given situation. (check the assignment questions)

40
New cards
<p>• Is this stop and wait protocol?</p><p>• What is the equation for Sender utilization?</p><p>• How many number of bits required for this protocol?</p>

• Is this stop and wait protocol?

• What is the equation for Sender utilization?

• How many number of bits required for this protocol?

1) Pipelining: increased utilization

2) (L / R) / [ (L / R) + RTT ]

3)

  • For Go-Back-N: Need k bits such that: 𝑁 ≤ 2^𝑘 − 1

  • For Selective Repeat: Need k bits such that 𝑁 ≤ 2^(𝑘 − 1)

  • Plug in the window size for N and solve for k. k is the number of required bits for the protocol.

41
New cards

Host A and B are communicating over a TCP connection, 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 first segment and second segments contain 80 and 40 bytes of data, respectively. In the first segment the sequence number is 127. Host B sends an acknowledgment whenever it receives a segment from Host A.

A) In the second segment sent from Host A to B, what is the sequence number?

B) If the first segment arrives before the second segment, in the acknowledgment of the arriving segment, what is the acknowledgment number Host B will send?

C) If the second segment arrives before the first segment, in the acknowledgment of the arriving segment, what is the acknowledgment number Host B will send?

A) 207

B) 207

C) 127

42
New cards

Suppose Host A sends two TCP segments back-to-back to Host B over a TCP connection. The first segment has sequence number 90; the second has sequence number 110.

Suggestion: draw the scenario

A) How much data is in the first segment?

B) Suppose that the first segment is lost but the second segment arrives at B.  In the acknowledgment that Host B sends to Host A, what will be the acknowledgment number?

A) 20 bytes

B) ACK number = 90

43
New cards
<p>TCP Segment Structure</p><ul><li><p>Sequence number, Acknowledgement number</p></li></ul><p></p>

TCP Segment Structure

  • Sequence number, Acknowledgement number

Port Number, sequence number, acknowledgement number, checksum, data = big box… know which thing goes to which box

UDP everything 16, Data is 32

TCP Port number = 16 bit

Length and checksum of UDP = 16 bit

Sequence number = 32

ACK = 32 bit

TCP header = 16 bit

TCP header length = 4 bit

44
New cards

RDT 1.0

Basics of reliability (No packet loss, not out of order, and reliable transport)

Recover: ACK/NAK

Can retransmit but could be duplicate so intro to sequence number

45
New cards

TCP Overview

point-to-point:

  • one sender, one receiver

reliable, in-order byte steam:

  • no “message boundaries"

full duplex data:

  • bi-directional data flow in same connection

  • MSS = Maximum Segment size

46
New cards

Why rdt protocols are stop and wait protocol?

Because after sending a packet, they have to wait for the ACK for the packet before sending next one to ensure accurate packet delivery

47
New cards

GBN receiver does not have receiver buffer, What are the disadvantages of not having receiver buffer in GBN?

DisAdv:

  • If it receives a packet out of order, can’t remember it bc it is waiting for the one in order

    • If you have a buffer, it can remember the packet out of order and when it is time to send ACK for the buffer. Can send the ACK without needing to be resent

    • If GBN is not in order, have to retransmit all of them

48
New cards

In Selective Repeat why it is necessary for SR receiver to send ACK when, packet has arrived in the previous window [receiver_base –n, receiver_base -1].

Until that ACK is received the window can’t slide up

  • If the ACK is NOT received, since there is a timer, there will be a loop for retransmitting

  • Also window can’t be moved forward

Explore top notes

note
Chapter 8: Rotational Kinematics
Updated 707d ago
0.0(0)
note
Cell: The Unit of Life
Updated 1223d ago
0.0(0)
note
social security and ERISA
Updated 1197d ago
0.0(0)
note
allemand
Updated 1276d ago
0.0(0)
note
Science Test: Volcanoes
Updated 648d ago
0.0(0)
note
German Case Endings
Updated 562d ago
0.0(0)
note
Ancient Egypt (notes)
Updated 1002d ago
0.0(0)
note
Chapter 8: Rotational Kinematics
Updated 707d ago
0.0(0)
note
Cell: The Unit of Life
Updated 1223d ago
0.0(0)
note
social security and ERISA
Updated 1197d ago
0.0(0)
note
allemand
Updated 1276d ago
0.0(0)
note
Science Test: Volcanoes
Updated 648d ago
0.0(0)
note
German Case Endings
Updated 562d ago
0.0(0)
note
Ancient Egypt (notes)
Updated 1002d ago
0.0(0)

Explore top flashcards

flashcards
Bio - Exam intra 1
108
Updated 533d ago
0.0(0)
flashcards
history 1302 exam one
23
Updated 398d ago
0.0(0)
flashcards
Mitosis + Asexual Reproduction
34
Updated 1099d ago
0.0(0)
flashcards
Criminal Law Midterm
50
Updated 379d ago
0.0(0)
flashcards
Unit 1 Terms/Concepts
49
Updated 912d ago
0.0(0)
flashcards
MODULE 2
41
Updated 163d ago
0.0(0)
flashcards
Female Reproductive System
30
Updated 96d ago
0.0(0)
flashcards
Bio - Exam intra 1
108
Updated 533d ago
0.0(0)
flashcards
history 1302 exam one
23
Updated 398d ago
0.0(0)
flashcards
Mitosis + Asexual Reproduction
34
Updated 1099d ago
0.0(0)
flashcards
Criminal Law Midterm
50
Updated 379d ago
0.0(0)
flashcards
Unit 1 Terms/Concepts
49
Updated 912d ago
0.0(0)
flashcards
MODULE 2
41
Updated 163d ago
0.0(0)
flashcards
Female Reproductive System
30
Updated 96d ago
0.0(0)