Net215 Quiz 2 - ConnorEast/Tech-Journal GitHub Wiki

TCP

Features of TCP

  • Connection Oriented: requires a connection for data transfer
  • Point-to-Point communication: Each TCP connection has two end points
  • Complete Reliability: Data received will be fully complete in the correct order
  • Full Duplex Communication: Allows concurrent data flow between devices

3-Way Handshake

  • The 3-way handshake is, put simply, the establishment of a connection between server and browser for reliable use.

TCP 3-way handshake "Flags"

  1. Syn: The synchronize flag is set in the tcp header to allow for error handling. This should only be sent from the client.
  2. Syn-Ack: The Synchronize Acknowledgement should be set in the servers packet. It essentially states; "I acknowledge your syn, heres mine"
  3. Ack: The Client responds back to the server with the Servers sent ACK Number thus oppening the communication chain between server and client.

Sequence Numbers

  • 32 bit number, Set by the client, used for data handling and packet organization. This number will increase by the amount of bytes sent.

Acknowledgement Numbers

  • 32 bit number, Set by the Server, used for data handling and packet organization. This number will increase by the amount of bytes sent.

TCP Window Size

  • A number set between 0 & 65,000. Used for data handling

TCP Sliding Window

  • However many bytes are set in the window size is how many bytes of data the device will be accepted in packets attempting to transfer to the source

TCP Zero Window

  • If the window is set to zero, any and all data packets will be dropped upon arrival. A response will be sent notifing the source that its packet was seen but was dropped.

TCP Retransmission

  • If the source does not receive a response within the time allotted by the stop watch then the source will resend the previously sent packet.

UDP

Applications using udp

  • Streaming platforms, DHCP/DNS request/reply exchanges

Layer 4 multiplexing/de-multiplexing

  • MultiPlexing: Multi-socket communication allowing for data transferance in both directions. Uses an ephemeral port as well as the port which is used for the specific task IE:80[HTMl], 8006[Proxmox]. The same ip can both recieve and send packets using seperate ports.
  • De-Multiplexing: Seperates data which has been combined by multiplexing into individual datastreams.

Layer 4 ports

  • Most common APPs are on port #’s 0:1023
  • Registered Ports are between 1024:49151
  • Private/Dynamic Ports that can be used are 49152:65535

Sockets

  • Sockets are when an IP Port pair has been established. 192.168.2.5:80 [Website on IP], 192.168.2.5:8006 [Base proxmox server], et;all

UDP Header

  • Source Port: Where does the packet come from? [2 bytes/16bits]
  • Destination Port: Where is the packet going to? [2 bytes/16bits]
  • Length: How big is the packet? [2 bytes/16bits]
  • Checksum Checks for errors. [2 bytes/16bits]
  • Data: What is sent in the packet

DHCP

Operation phases

  • Discover: Client Uses a broadcast [IP:"255.255.255.255"] to locate the DHCP server (67)
  • Offer: Server sees the broadcast and offers an IP [sent to "source MAC"] from its range (68)
  • Request: Client responds with a "yes I want that address" (67)
  • Acknowledge: Server Acknowledges the IP assignment and leases it to the device (68)
  • DHCP Pack: Server Acknowledges renewal requests.

DORA

Discover Packet:

> Layer 2: Ethernet → DST: ff:ff:ff:ff:ff:ff

> Layer 3: IP → 0.0.0.0; DST: 255:255:255:255

> Layer 4: UDP → Port 68 (client), Port 67 (Server)

> Layer 5: DHCP → Option 53, DHCP:Discover (1)

Offer Packet:

> Layer 2: Ethernet → DST: 00:0c:29:59:fd:21

> Layer 3: IP → src:[DHCP-IP], dst: [Offered-IP]

> Layer 4: UDP → Port 67 (Server)

> Layer 5: DHCP → Option 53, DHCP:Offer (2) [BootP Info]

Request Packet:

> Layer 2: Ethernet → DST: ff:ff:ff:ff:ff:ff

> Layer 3: IP → 0.0.0.0; DST: 255:255:255:255

> Layer 4: UDP → Port 68 (client)

> Layer 5: DHCP → Option 53, DHCP:Request (3)

Acknowledge Packet:

> Layer 2: Ethernet → DST: ff:ff:ff:ff:ff:ff

> Layer 3: IP → src:[DHCP-IP], dst: [Offered-IP]

> Layer 4: UDP → Port 67 (Server)

> Layer 5: DHCP → Option 53, DHCP:Acknowledge (4)

DHCP Leases

  • DHCP leases are the TTL of DHCP. Essentially they force reconnection between client and server every [insert specified time here]. IF the Lease runs out; the device will no longer be able to use the specified IP given to it

DHCP Renewal and Rebinding

  • DHCP Renewal: Uses DHcP Request & DHCP Pack
  • DHCP Rebinding: After 50% of the lease period [T1] renewal requests begin. If it does not here back by 87.5% of the lease period [T2] it will increase frequency of renewal requests

Parsing DHCP headers

  • OpCode: Indicates whether the packet is a request or a reply
  • Hardware Type: The type of hardware address
  • Hardware Length:The length of the hardware address
  • Hops: Used by relay agents to assist in finding a DHCP server
  • Transaction ID: A random number to pair requests with responses
  • Seconds Elapsed: Seconds since the client first requested an address from the DHCP server
  • Flags: The types of traffic the DHCP client can accept (unicast, broadcast, and so on)

DNS

Address Resolution

DNS Hierarchy / Levels

  1. Root: Highest on the hierarchy, has all top-level domains cached for communication.
  2. Top-level-domain: Second highest on the hierarchy, has all Authoritative domains cached for its sect [.edu/.com./.gov/et;all]
  3. Authoritative Servers: The final item in the hierarchy, contains specific DNS records which are stored and saved laterally between servers for higher reliability.

Role of Resource Records

  • Contains the information neccessary to resolve a named address. Includes: Domain Name [FQDN], Type [A,AAAA, et;all], TTL, and Value [IP]

Iterative and Recursive Queries

  1. Iterative: DNS query sent from client to root which then searches for DNS information, from each Authoratative server in the specified domain, before returning it to the client
  2. Recursive: DNS queries root. Root responds "I don't know ask this server". Source queries server and gets the response "I dont know ask my neighbor". This occurs until an answer has been found.

VLAN

Access/Trunk Ports

  • Access Ports: these ports only allow for data transfer from a specific IP/VLAN interface
  • Trunk ports: These ports allow for communication between multiple vlans/IP spaces over a single crossover/serial connection.

Communication between vlans

  • VLANs, unless otherwise specified, should not be accessible to one another. A device on VLAN 10 should not be able to communicate with a device on VLAN 30.

⚠️ **GitHub.com Fallback** ⚠️