TCP/UDP Flashcards

1
Q

TCP

A

Transmission Control Protocol

Used by the transport layer to establish a connection, before communication can occur

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

TCP three way handshake

A
  1. SYN

Once the client has the server’s ip address, the client sends a syn message (Synchronised message)to server

  1. SYN-ACK

Once the server receives the syn message it responds with a SYN-ACK message, letting the client know that it has recieved and acknoledges the client’s syn essage

  1. ACK

Once the client recieves the server’s SYN-ACK message, it responds with an ACK message to acknowledge receiving the SYN-ACK. The session or connection becomes established as soon as the server receives the ACK message from the client.

Once the session has been established, information can be sent using other protocols like HTTP

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

TCP 4 way disconect

A
  1. FIN

server sends client FIN message to let it know that it is finished

  1. FIN-ACK

The client acknowledges receiving the FIN message by sending a FIN-ACK message

  1. FIN

The client will follow that message with another FIN message to let the server know that it is finished

  1. The server then responds with a FIN-ACK message, acknowledging receipt of the clients FIN message, after which the connection is close, and the client may no longer send any requests
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

TCP RESET

A

A quick way of disconnecting or closing a connection by sending an RST message

RST messages can also be sent by a firewall that sits in-between the client and the server

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

UDP

A

User Datagram Protocol

Transport Layer protocol that is used for sending data

Unlike TCP, UDP does not establish a connection before making request, instead it simply sends a request for data and the server complies by sending data if it exists

With UDP there are no:

  1. 3 way handshakes
  2. reliable communication
  3. sequence numbers
  4. acknowledge numbers
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

when is UDP more useful than tcp?

A

When sending small amounts of data

example:

DNS protocol - sending messages to a DNS server asking from the ip address associated with a domain name

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

Transport layer addressing

A

Port numbers:

  • 0 - 65
  • 535

TCP headers always include source (ephemeral) and destination port (Well Known) numbers

2 types of port numbers:

  1. Server Port Numbers
    - well known / registered
    - Port Numbers
  2. Client Port Numbers
    - Ephemeral Port Numbers
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Range of Well Known Port Numbers

A

0 - 1023

HTTP: 80
HTTPs: 443
FTP: 20,21
SSH: 22
Telnet: 23
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Range of Registered Port Numbers

A

1024 - 49151

Custom Applications (official/ unofficial)

H.323
SIP
Radius

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

Range of Ephemeral Port Numbers

A

49152 - 65535

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

Protocol dependencies

A

Layer 7 protocols all have layer 4 port numbers assigned to them

the port numbers are assigned to a layer 4 protocol either TCP or UDP

All of the above uses the IP protocol at the network layer

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

TCP Protocol dependencies

A

Layer 7

HTTP: 80
HTTPs: 443
FTP: 20,21
SFTP: 22
SMB: 445
POP3: 110,995
IMAP: 143/993
SMTP: 25/587
LDAPs: 636

Telnet:23
SSH: 22
RDP: 3389

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

BOTH TCP and UDP protocol dependencies

A

Layer 7

LDAP: 389

DNS:53
SIP: 5060
H.323: 1719
SNMP: 161

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

UDP protocol dependencies

A

Layer 7

TFTP: 69

DHCP: 68,69
NTP: 123

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