UDP Flashcards

1
Q

Describe the steps of a UDP client

A

1) Make a DatagramSocket
2) Make a DatagramPacket with payload and destination (server) host & port
3) .send the DatagramPacket a UDP packet
4) Make an empty DatagramPacket
5) .receive the next UDP packet into that DatagramPacket

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Describe the steps of a UDP server

A

1) Make a DatagramSocket with known port
2) (repeat)
3) Make an empty DatagramPacket
4) .receive the next UDP packet into that DatagramPacket
5) …
6) Make a DatagramPacket with payload
7) .send the DatagramPacket as a UDP packet

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Name 4 UDP considerations

A

Message size, blocking, receive from any, failure model

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Describe message size

A

Hard limit of 65508 bytes but often 8k or less
Larger messages are broken up into smaller fragments on most physical networks and is reassembled by the receiver - less reliable

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Describe blocking

A

Receive normally blocks until a message is received

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Describe receive from any

A

Normally a socket will accept messages from any sender

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Describe failure model

A

Best effort like IP
Checksums detect most corruption of messages and discard them
Messages may be dropped due to corruption, no space in buffer at end system or in network (congestion)
Messages may arrive out of order and may be occasionally duplicated

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Describe the uses of TCP

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly