Socket Programming Flashcards

1
Q

TCP Procedure

A

Must set up connection before sending

  1. Create pipe
  2. Send data through pipe
  3. Close pipe
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

UDP Procedure

A

Unreliable, No pipe, label each packet with destination (IP and port)

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

Socket

A

Reliable, byte-stream oriented. Door between application process and end-end transport protocol

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

TCP Socket Programming

A
  1. Server set-up (tcp and client socket)
  2. Client set-up (socket and server socket) sends TCP connection to server
  3. Server waits for TCP request, accepts client socket
  4. Client sends request using socket
  5. Server reads request from socket and sends reply to socket
  6. Client read reply from socket
  7. Both endpoints close the TCP
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

UDP Socket Programming

A
  1. Server creates socket
  2. Client makes socket
  3. Client makes datagram (message) with server IP and port included, and sends it to server
  4. Server reads datagram from socket and writes reply with client IP and port to socket
  5. Client read reply from socket and closes socket
  6. Server keeps socket open
How well did you know this?
1
Not at all
2
3
4
5
Perfectly