πŸ–₯️Networking

Common Terms

  • (FQDN) Fully Qualified Domain Network - Example: http://google.com

  • (DMZ) Demilitarized Zone - A subnet that exposes an organization's external-facing services to an untrusted, usually larger, network.

Network Types

  • (WAN) Wide Area Network - Internet or a large number of LANs joined together sometimes called an "Intranet"

  • (LAN/WLAN) - Local Area Network / Wireless Local Network - Assigns an IP for local use:

    • 192.168.0.0

    • 10.10.0.0

  • (VPN) Virtual Private Network - Lets the user connect to a private network from a public connection:

  • (GAN) Global Area Network - A worldwide network like the internet or WANS joined together internationally

  • (MAN) Metropolitan Area Network - A series of LANs that connect in geographical proximity.

  • (PAN/WPAN) Personal Area Network / Wireless Personal Area Network

    • PAN - Enables us to connect many devices locally to form an ad-hoc network.

    • WPAN - Bluetooth or Wireless USB technologies.

Topologies

Connections

Wired
Wireless

Coxical Cabling

Wifi

Glas Fiber Cables

Celluar

others

Satelite

Nodes - (NICs) Network Interface Controller

Router

Hubs

Bridges

Switches

Modem/ Routers

Gateways

Firewalls

Classifications

Point to Point

Bus

Star

Ring

Mesh

Tree

Hybrid

Daisy Chain

A topology is a structure of a network, it can be physical or logical.

Point-to-Point

The simplest network with a connection between two hosts.

Host A -> Host B

Proxies

When a device or service sits in the middle of a connection and acts as a mediator. The key types of proxies are:

  • Dedicated / Forward Proxy

    • The standard proxy is when a client makes a request to a computer and the computer carries out the request.

    • Used in Burp when forward HTTP requests.

  • Reverse Proxy

    • Reverse of a forward proxy. Filters incoming requests. Listen to an address and forward it to a closed-off network.

    • Useful for bypassing firewalls and evading logging.

  • Transparent Proxy

Networking Models

©️HTB

(OSI) Open System Interconnection Model

Consists of seven layers each with its separate tasks.

Layer
Function

[7] - Application

Controls the input and output of data and provides application function

[6] Presentation

Transfers the system-dependent presentation of data

[5] Session

Controls logical connection between two systems and prevents connection breakdowns

[4] Transport

Used for end-to-end control of the transferred data

[3] Network

Connections are established in this layer and data packets are forwarded in packet-switched networks

[2] Date Link

Enables reliable and error-free transmission, the bitstreams from layer 1 are divided into blocks of frames

[1] Physical

Takes place on wired or wireless transmission lines, the transmission techniques sued are for electrical signals, optical signals or electromagnetic waves.

(TCP/IP) Transport Control Protocol/ Internet Protocol

Responsible for the switching and transport of packets of data on the internet. Located between the Network Layer(3) and the Transport Layer(4).

Layer
Function

[4] Application

Allow applications to access the other services layers and define protocols they use to exchange data.

[3] Transport

Responsible for providing (TCP) session and (UDP) datagram services for the Application layer.

[2] Internet

Responsible for host addressing, packing and routing.

[1] Link

Responsible for placing the TCP/IP packets on the network and receiving packets for the network.

The most important tasks of TCP/IP

  • Logical Addressing - Within TCP/IP, IP is responsible for logical addressing of network and node so data packets only go where they are supposed to be.

  • Routing - A data packet is routed to its receiver even if the actual sender's location is unknown.

  • Error & Control Flow - The sender and receiver are in touch with each other and control messages are sent continuously to check the connection is still active.

  • Name Resolution - DNS provides name resolution through FGDN in IP addresses.

IPv4 Structure

Class

Network Address

First Address

Last Address

Subnetmask

CIDR

Subnets

IPs

A

1.0.0.0

1.0.0.1

127.255.255.255

255.0.0.0

/8

127

16,777,214 + 2

B

128.0.0.0

128.0.0.1

191.255.255.255

255.255.0.0

/16

16,384

65,534 + 2

C

192.0.0.0

192.0.0.1

223.255.255.255

255.255.255.0

/24

2,097,152

254 + 2

D

224.0.0.0

224.0.0.1

239.255.255.255

Multicast

Multicast

Multicast

Multicast

E

240.0.0.0

240.0.0.1

255.255.255.255

reserved

reserved

reserved

reserved

Subnet Mask

Class

Network Address

First Address

Last Address

Subnetmask

CIDR

Subnets

IPs

A

1.0.0.0

1.0.0.1

127.255.255.255

255.0.0.0

/8

127

16,777,214 + 2

B

128.0.0.0

128.0.0.1

191.255.255.255

255.255.0.0

/16

16,384

65,534 + 2

C

192.0.0.0

192.0.0.1

223.255.255.255

255.255.255.0

/24

2,097,152

254 + 2

D

224.0.0.0

224.0.0.1

239.255.255.255

Multicast

Multicast

Multicast

Multicast

E

240.0.0.0

240.0.0.1

255.255.255.255

reserved

reserved

reserved

reserved

TCP Handshake

  1. The client sends a TCP packet to the server. The packet has the SYN flag enabled and a random sequence number set.

  2. The server replies by sending a packet with both the SYN and ACK flag set and another random sequence number (ACK number is always a simple increment of the SYN)

  3. Finally, the client completes by sending an ACK packet.

UDP Connection

UDP is stateless, no acknowledgement is sent during a connection.

Last updated

Was this helpful?