Network Architecture and Security Exam Notes
Physical Layer
- Purpose:
- Establishes physical connections between data link layer entities (e.g., NICs) via a shared medium (wired or wireless).
- Governed by ISO definition: Mechanical, Electrical, Functional, and Procedural aspects to start, maintain, and end physical (PHY) connections
- Transforms data frames from the data link layer into signals for transmission over a physical medium.
- The receiving NIC re-encapsulates the frame.
- PHY Governing Standards:
- PHY components (HW devices, media, connectors) e.g. NICs, interfaces, cables
- Encoding / Signaling schemes
PHY Encoding
- Encoding: Conversion of data bits into predefined codes for predictable recognition by sender and receiver.
- Codes: Grouping of bits (0s and 1s) in a predictable pattern.
- Examples:
- Manchester
- 4B/5B
- 8B/10B
- Manchester Encoding:
- Transition at the middle of each bit period.
- High-to-low transition = 0, Low-to-high transition = 1.
- Used in older 10 Mbps Ethernet (10Base-T). Faster speeds require more complex encoding.
- 4B/5B Encoding:
- Maps 4 data bits into a 5-bit transmission code.
- Introduces 25% overhead.
- Example: 0000 -> 11110, 0001 -> 01001, etc.
- 100Base-TX: Fast Ethernet, uses 4B/5B.
- 1000Base-T: Gigabit Ethernet, uses 8B/10B.
PHY Signalling
- Signalling: Representation of bit values (0 and 1) in the physical medium.
- Method is medium-dependent (copper, fiber optic, wireless).
- Self-Clocking Signal:
- A signal that can be decoded without the need for a separate clock signal for synchronization.
- Manchester encoding is a self-clocking signal.
- Bandwidth:
- The medium’s capacity to carry data (amount per time, e.g., bits/second).
- Affected by physical media properties, technologies, and PHY mechanisms.
- Units: bps, Kbps (), Mbps (), Gbps (), Tbps ().
- Any signal is potentially an infinite series of harmonic signals.
- Peak amplitude represents signal strength.
- Frequency is measured in waves per second.
- Different harmonic signals weaken (attenuate) differently; higher frequency signals weaken faster.
- Bandwidth of the medium is the part of the spectrum that doesn't weaken significantly.
- More bits sent means less space for harmonics, making it harder for the receiver to read the signal.
- Nyquist's Theorem:
- To flawlessly read an incoming signal, sample with a frequency of at least 2H, where H is the upper bandwidth limit.
- Formula for channel capacity: bps, with V being the number of discrete levels (e.g., binary channel V=2).
- Shannon's Theorem:
- Maximum error-free data rate depends on noise contamination in the channel.
- Formula: bps, where S is signal strength and N is noise level.
PHY Terminology
- Bit-rate: number of bits per second.
- Baud-rate: number of symbols (signals) transmitted per unit of time.
- If one signal can carry multiple bits, bit-rate > baud-rate.
- If there is redundancy in encoding, bit-rate < baud-rate.
- In binary signal bit-rate = baud-rate
- Latency (Delay, Lag):
- Time for data to travel from one point to another.
- Expressed in milliseconds or microseconds.
- Throughput:
- Measure of bit transfer across media over a specified period.
- Expressed in Xbps.
- Goodput:
- Measure of usable data transferred.
- Overhead encompasses protocol headers and retransmitted data.
Cabling
- Network Media Types:
- Copper: Cheap, easy to install, vulnerable to attenuation, EMI/RFI, crosstalk
- UTP: Common, RJ-45 connector
- STP: Better noise protection, harder to install, RJ-45
- Coaxial: Used for cable Internet (DOCSIS), antennas
- Fiber Optics: High bandwidth, long distance, expensive, less susceptible to attenuation, no EMI/RFI
- Wireless
- Copper: Cheap, easy to install, vulnerable to attenuation, EMI/RFI, crosstalk
- EMI: Electromagnetic Interference.
- RFI: Radio Frequency Interference.
- Mitigation Strategies:
- Attenuation: Cable length limits.
- EMI/RFI: Metallic shielding and grounding.
- Crosstalk: Twisting wire pairs.
- Physical protection, interference protection, identification/isolation
- UTP Cabling:
- Four twisted pairs of copper wires within a flexible plastic sheath.
- Relies on cancellation and variation in twists to limit crosstalk.
- Cancellation: Each wire in a pair uses opposite polarity; magnetic fields cancel each other.
- Variation in twists: Varying twist rates prevent crosstalk.
- UTP Standards:
- Defined by TIA/EIA-568 for cable type, length, connectors, termination, testing.
- IEEE defines electrical standards according to performance.
- Examples: CAT3 (voice), CAT5 & 5e (100, 1G), CAT6 (10G).
- Straight-Through vs. Crossover Cables:
- Straight-through: Host to network device
- Crossover: Host-to-host, switch-to-switch (legacy; Auto MDI-X negates the requiremnt for crossover cables on modern NICs)
- Rollover: Cisco Proprietary; Host serial port to Router/Switch Console Port.
- Fiber Optics:
- Encodes data as light pulses (LED or laser).
- High bandwidth, long distances.
- Less attenuation and no EMI/RFI susceptibility.
- Fiber optic cable acts as a waveguide for light.
- 30% slower than the speed of light in a vacuum.
- Dispersion: Spreading of light pulse over time; more dispersion is More signal loss.
- MMF (Multi-Mode Fiber): greater dispersion; Max Distance 550m
- SMF (Single-Mode Fiber): Less dispersion.
- Fiber Optic Uses:
- Enterprise Networks: Backbone cabling.
- FTTH (Fiber-to-the-Home): Broadband services to homes.
- Long-Haul Networks: Connecting cities and countries.
- Submarine Cable Networks: Transoceanic distances.
- Fiber Optic Connectors:
- ST (Straight Tip), SC (Subscriber Connector), LC (Lucent Connector).
- Simplex, duplex, multimode LC connectors.
- Yellow jacket: Single-mode fiber, Orange (or aqua): Multimode Fiber.
- Fiber vs Copper Summary:
- Fiber used for backbone cabling, high-traffic, point-to-point links, inter-building connections in campuses.
| Feature | UTP Cabling | Fiber-Optic Cabling |
|---|---|---|
| Bandwidth | 10 Mb/s - 10 Gb/s | 10 Mb/s - 100 Gb/s |
| Distance | Short (1-100 meters) | Long (1 - 100,000 meters) |
| EMI/RFI Immunity | Low | High (Completely immune) |
| Electrical Hazard Immunity | Low | High (Completely immune) |
| Costs (Media and Connectors) | Lowest | Highest |
| Installation Skills | Lowest | Highest |
| Safety Precautions | Lowest | Highest |
Wireless Media
- Uses radio waves (<300 GHz) or microwaves (300 MHz – 300 GHz).
- Provides mobility.
- Limitations:
- Coverage area is impacted by physical characteristics.
- Subject to interference.
- Anyone can access the transmission medium if not secured
- Shared medium (half-duplex in WLANs).
- IEEE and Telecom Industry Standards:
- Cover data link and physical layers.
- PHY Specifications Dictate:
- Data to radio signal encoding methods.
- Frequency and power of transmission.
- Signal reception and decoding requirements.
- Antenna design and construction.
- ISM Band:
- Industrial, Scientific, and Medical frequency band.
- Used by Wi-Fi, Bluetooth, and Zigbee.
- Wireless Standards:
- Wi-Fi (IEEE 802.11): Wireless LAN (WLAN) technology.
- Bluetooth (IEEE 802.15.1): Wireless Personal Area Network (WPAN) standard.
- WiMAX (IEEE 802.16): Point-to-multipoint broadband.
- Zigbee (IEEE 802.15.4): Low-data rate, low-power for IoT.
- Wireless Modes:
- Infrastructure: communication through Access Point.
- Ad-hoc: Direct device-to-device communication.
- Mesh: Node-to-node relay communication.
- Infrastructure Mode:
- Typical Wi-Fi (802.11 WLAN) setup.
- Nodes have wireless NICs.
- AP connected to a wired infrastructure for WAN/Internet access.
- Requires strict security to prevent packet sniffing and unauthorized access.
Wireless Standards (Digital Cellular, Public Safety, LPWAN, Connectivity, GNSS)
- Digital Cellular Standards (5G NR, LTE, WCDMA, GSM, CDMA2000, WiMAX)
- Public Safety Standards (TETRA, DMR, Project 25)
- LPWAN (SIGFOX, LoRaWAN)
- Wireless Connectivity (WLAN/WiFi, Bluetooth, UWB, ZigBee, NFC, DECT, ULE)
- GNSS (GPS, Galileo, GLONASS, BeiDou, QZSS, IRNSS)
- Frequency Ranges and bands are defined for various technologies
- Modulation types include QAM, QPSK, BPSK, GMSK, FSK, and others
- Transmission methods include CP-OFDM, OFDMA, SC-FDMA, TDMA, CDMA, etc
- Duplex methods include FDD and TDD
- Channel bandwidth also varies depending on the technology
- Peak data rate also varies widely depending on the technology
- Standardization forums include www.3gpp.org, www.ieee802.org, and others
- Glossary of terms provides descriptions of acronyms and technologies
Binary Number System
- Binary uses 1s and 0s (bits).
- Decimal uses digits 0 through 9.
- Hosts, servers, and network equipment use binary addressing.
- IPv4 addresses consist of 32 bits, divided into four 8-bit (1-byte) octets.
- Dotted notation (decimal) is used for IPv4 addresses for human readability.
- Positional Notation:
- Digit values depend on their position in a number sequence.
- Decimal system uses powers of 10 (Radix 10).
- Binary system uses powers of 2 (Radix 2).
- Decimal Positional Notation:
- Calculate positional values as powers of 10.
- Example: 1234 = (1 x 1000) + (2 x 100) + (3 x 10) + (4 x 1)
- Binary Positional Notation:
- Calculate positional values as powers of 2.
- Example: 11000000 = (1 x 128) + (1 x 64) + (0 x 32) + (0 x 16) + (0 x 8) + (0 x 4) + (0 x 2) + (0 x 1) = 192 decimal
- Binary to Decimal Conversion:
- Add the positional values where the binary digit is 1.
- Decimal to Binary Conversion:
- Determine which positional values fit into the decimal number and mark those positions with 1s. Remaining positions get 0s.
Hexadecimal Number System
- Base-16 numbering system (0-9 and A-F).
- Easier to represent values in hexadecimal than in binary.
- Used for IPv6 addresses (128 bits = 32 hex digits) and MAC addresses (48 bits = 12 hex digits).
- IPv6 addresses are 128 bits (32 hexadecimal values), divided into hextets (4 hex characters).
- Decimal to Hex Conversion Steps
- Convert the decimal number to 8-bit binary strings.
- Divide the binary strings in groups of four starting from the rightmost position.
- Convert each four binary numbers into their equivalent hexadecimal digit.
- Hexadecimal to Decimal Conversions
- Convert the hexadecimal number to 4-bit binary strings.
- Create 8-bit binary grouping starting from the rightmost position.
- Convert each 8-bit binary grouping into their equivalent decimal digit.
Datalink Layer
- Responsible for communication between end-point NICs, gives upper layers access to PHY media, and encapsulates network layer (L3) packets.
- L1 Service (Physical Layer): Bit-stream transfers, unreliable (bits can be changed).
- L2 Service (Data link Layer): Frame transfers between adjacent stations via a physical channel.
- L2 Functions:
- Data transmission
- Error detection & correction
- Flow control
- Configuration management
- Data Link sublayers (IEEE LAN/MAN): Specific to network type (Ethernet, WAN, WPAN).
- Two Sub-Layers:
- LLC (Logical Link Control): Communicates between networking software and device hardware.
- MAC (Media Access Control): For data encapsulation and media access control.
- Packets may move between L1 and L2 transitions (middleboxes perform basic L2 functions like accepting, decapsulating, re-encapsulating, and forwarding frames).
Topologies
- Network Topology: Arrangement/relationship of network devices and their interconnections (physical vs. logical).
- WAN Topologies:
- Point-to-point (P2P): Persistent link between 2 endpoints.
- Hub and Spoke: Central site interconnects others via P2P.
- Mesh: High availability via many-to-many connections.
- LAN Topologies:
- Star or extended star: Easy to install and troubleshoot.
- Early Ethernet & Legacy Token Ring:
- Bus: Systems chained together and terminated at ends.
- Ring: Each device connects to a neighbor, forming a circle.
- Media Access Control (MAC):
- Half-duplex: Bi-directional, one direction at a time (e.g., WLANs and old bus topologies).
- Full-duplex: Bi-directional simultaneously (e.g., Ethernet).
Access Control Methods
- Contention-Based: Multiple nodes contend for access.
- CSMA/CD (Carrier Sense Multiple Access with Collision Detection)
- Used on legacy bus-topology Ethernet.
- CSMA/CA (Carrier Sense Multiple Access with Collision Avoidance)
- Used on Wireless LANs.
- CSMA/CD (Carrier Sense Multiple Access with Collision Detection)
- Controlled Access: Deterministic access where nodes get dedicated transmission time.
- Used on legacy token ring networks.
- Can be reservation, polling, or token access.
ALOHA, CSMA and CSMA/CD
- ALOHA:
- Users transmit whenever they have data.
- Retry after a random time if collision occurs.
- Efficient under low load/delay.
- CSMA:
- Improves ALOHA by sensing the channel.
- Users don’t send if they sense ongoing transmission.
- 1-Persistent (greedy): Sends as soon as idle.
- Non-Persistent: Waits a random time then tries again.
- p-Persistent: Sends with probability p when idle.
- CSMA/CD:
- Detects/aborts collisions; reduces contention time.
- Used in legacy Ethernet LANs operating in half-duplex.
- Devices back-off to avoid collisions and retransmit.
- CSMA/CA:
- Used by IEEE 802.11 WLANs.
- Half-duplex.
- Devices include the time needed for transmission.
- Other devices receive time info to avoid collision.
- Inserts back-off slots to avoid collision.
- MAC uses ACKs/retransmissions for wireless errors.
Link Data Frame
Data encapsulated with header and trailer to form a frame.
The header and trailer contain L2 address (MAC), start/stop flags, type, flags, and error detection.
Protocol used depends on logical topology and physical media.
- Ethernet, IEEE 802.11, PPP (Point-to-Point), HDLC (High-level Data Link Control), Frame Relay
Ethernet
Frame Start and Stop Identifies beginning and end of frame
Addressing Indicates source and destination nodes
Type Identifies encapsulated Layer 3 protocol
Control Identifies flow control services
Data Contains the frame payload
Error Detection Used to determine transmission errors
Ethernet Switching
Ethernet: Family of wired networking technologies (802.3 PHY & 802.2/802.3 DLL protocols).
- LLC sublayer (802.2): places information in the frame to identify the used network layer protocol.
- MAC sublayer (802.3, .11, .15): data encapsulation, media access control, and DL layer addressing
Data Encapsulation (IEEE 802.3):
- Ethernet frame: Internal structure of the Ethernet frame.
- Ethernet addressing: Source and destination MAC address used on the same LAN
- Ethernet error detection: Frame Check Sequence (FCS) trailer used for error detection -- Cyclic Redundancy Check (CRC-32) compute the FCS.
Ethernet MAC Sublayer
Data encapsulation, media access control, and DLL layer addressing.
Media Access Control (IEEE 802.3):
- Spec for various types of media (fiber, copper).
- Legacy Ethernet Bus Topology/Hubs: shared, half-duplex (CSMA/CD).
- Modern Ethernet LANs: Switches, full-duplex (collision-free).
Switches eliminate the need for CSMA/CD.
Ethernet Frames
- Ethernet MAC sublayer: data encapsulation, media access control, and DL layer addressing.
- Ethernet frame fields: min | max Ethernet frame size 64 | 1518 bytes. The preamble field is not included when describing the frame size.
- length(frame) < 64B: collision fragment/runt frame, discarded automatically.
- length(frame) >1500B data: jumbo/baby giant frames.
- Frames below 45B or above 1500B data are dropped.
- Indicates collisions or other unwanted signals.
- Jumbo frames can carry up to 9kBs of payload.
- Ethernet MAC Address:
- Consists of 48 bits (6 Bytes = 12 HEX).
- Each byte can range from 00 to FF. e.g., 0000 1010 = 0AHEX = 0x0A = 0A16 = 0AH
- Identifies a unique LAN device (NIC).
- Vendors register with IEEE for an OUI (Organizationally Unique Identifier, 3 bytes).
- Ethernet MAC address = OUI + vendor value.
- Frame Processing:
- Sending/forwarding device includes source/destination MAC.
- Receiving NIC compares the destination MAC addr. with MAC addr. stored in RAM
- Accepts unicast, multicast/broadcast that matches its RAM
- If match, sends frame up the OSI stack.
- Upper layers decapsulate frame.
- Frames with broadcast/multicast also get accepted by any devices subscribed/listening too. 8
- Different MAC addresses used for L2 unicast, multicast and broadcast
Types of Ethernet MAC Addresses:
- Unicast MAC Address: Unique, one-to-one communication (src to dst). Source MAC should ALWAYS be unicast!
- Address Resolution Protocol (ARP): finds the destination MAC address associated with 19 IPv4 address.
- Network Discovery (ND): Same as ARP for IPv6.
- Broadcast MAC Address: Processed by every device on Ethernet LAN.
- Dst MAC addr: FF-FF-FF-FF-FF-FF.
- Flooded out by the network/Ethernet switch on all switchports, except incoming.
- Not forwarded by routers.
- IPv4 dst addr host portion is all 1s (e.g., 192.168.1.255).
- All hosts on the network accept the packet.
- Multicast MAC Address: Ethernet multicast frame is received by all devices that belong to the same multicast group!
- Dst MAC addr for IP multicast packet: 01-00-5E (IPv4) and 33-33 (IPv6)
- Other values are used for non-IP encapsulated data (e.g., STP).
- Flooded out all Ethernet switch ports except the incoming port, unless the switch is configured for multicast snooping. Not forwarded by a router, unless the router is configured to route multicast packets.
- Represents a group of addresses (host group) and can only be used as dst MAC addr. Source MAC addr will always be a unicast.
- IP multicast address requires a corresponding multicast MAC.
Layer 2 Ethernet Switch (MAC Address Table Maintenance)
- Uses L2 MAC addresses for forwarding decisions. L2 Ethernet Switch is oblivious to higher-layer data (e.g., IPv4/6, ARP, ND).
- L2 Ethernet Switch maintains a MAC address table (also known content-addressable memory (CAM) table) to decide which port to forward or ingress the incoming frame to.
- MAC table starts empty at switch start-up.
- Learning function examines the source MAC address and arriving port number.
- If MAC doesn’t exist in table, add it.
- If it exists, update the refresh timer for that entry (5 min).
- If it exists but the port is different, make a new entry with the new port!
- Forwarding:
- If the destination MAC is unicast, and is matched or exists the L2 switch will search for and forward the frame to specified port within the MAC address table.
- If no match to the specified port, forward the frame to all ports except the ingress.
- If multicast or broadcast, flood on all ports except incoming
Forwarding Methods
Store-and-Forward Switching: Receives the entire frame. Computes CRC. If valid, lookup the destination address determining its outgoing interface and propogates it. Advantage: can determine error before propagations/saving bandwidth! Necessary for QoS when traffic prioritization is necessary ! e.g., for VoIP prioritization
Cut-Through Switching: Forwards frames before complete reception. Minimum destination address must read. No error checking!
Fast-forward switching: The fastest technique that offers the lowest level of latency by immediately forwarding a packet (reading destination address). Packets may be relayed with errors, discarding from NIC upon receipt.
Fragment-free switching: Storing and performing error check on the first 64 bytes of the frame before forwarding,ensuring that a collision has not occurred.
Compromise between the high latency and high integrity of store-and-forward techniques and the high integrity of fast-forward.
Switch Buffer Memory Types:
- Port-based memory: frames stored in queues w/specific incoming/outgoing ports
- possible that a single frame can delay the transmission of all frames in memory because of a busy destination port. This delay occurs even if the other frames could be transmitted to open destination ports.
- Shared memory: deposits all frames into a common memory buffer shared by all switch ports and the amount of buffer memory is dynamically allocated.
- larger frames that can be transmitted with fewer dropped frames,with asymmentic bandwidth,more bandwidth can be dedicated to certain ports (e.g., server port)
- Port-based memory: frames stored in queues w/specific incoming/outgoing ports
Duplex and Speed setting:
* two basic settings on a switch, bandwidth and duplex; which must match between the port and connected devices
* Duplex settings: full-duplex vs half-duplex
* Autonegotiation: enables two devices can automatically negotiate the best speed and duplex capabilities
* Duplex mismatch: reconfigure one side of a link and forgetting to reconfigure the other, auto-negation should be on both ports (full-duplex is best for all ports)
* Auto-MDIX: automatic medium-dependent interface crossover feature that does not require that one of the ports be configured as Host (crossover cable).
Network Layer
- Network Layer (L3): end-to-end communication. IPv4 and IPv6 are the two principal L3 protocols!
- Basic Operations: addressing, encapsulation, decapsulation, and routing.
- IP encapsulates transport layer PDU (segment for TCP, datagram for UDP).
- IP understandable by all L3 devices along the network path.
- IP addresses from along the end-to-end path (except with NAT)
IP Characteristics
- Connectionless, best-effort (BE) and media-independent
* no control info (sync, ack packets); connections have to be implemented by an L4 proto
* no packet delivery guarantee, losses may occur, no retry, no acks (unreliable!)
* may arrive out-of-sequence, with error/corrupted so; IP relies on L4 to implement these fixes!
* can be sent over fiber, copper, wireless
* different media handled by L3 establishing MTU supplied from L2 control info
* IP fragmentation in IPv4 - router from Ethernet to a slow WAN with smaller MTU, causes latency, but unsupported by IPv6
* Packets that are too large and needs fragmentation are dropped in a fragmentation and reassembly network due to path MTU discovery
Examples of IP Fragmentation & Path MTU Discovery
- Path MTU Discovery (PMTUD): avoids network fragmentation as Routers return Maxiumum Transmission Unit to source and discard large packets since Networks have different packet size limits for many reasons
IPv4 Packet Header
IPv4 packet header in binary with three major limitations
- address depletion, lack of E2E connectivity & increased networking complexity
Function Description
Version This will be for v4, as opposed to v6, a 4-bit field= 0100
Differentiated Services Used for QoS: DiffServ – DS field or the older IntServ – ToS or Type of Service
Header Checksum Detect corruption in the IPv4 header
Time to Live (TTL) Layer 3 hop count. When it becomes zero the router will discard the packet.
Protocol I.D.s next level protocol: ICMP, TCP, UDP, etc.
Source IPv4 Address 32-bit source address
Destination IPV4 Address 32-bit destination address
IP Addressing
- Addresses are allocated in blocks called prefixes, determined by network portion
Network addr/length -- e.g., 18.0.31.0/24
Carries carries size as part of address, inflexible (classful vs classless addressing)
Sub-netting splits up IP prefix to help with management of network known (to local routers)
Carries size as part of address
Inflexible
ISP gives network a single prefix
Network divides it into subnets internally
Classless InterDomain Routing (CIDR):
- More efficient use of IPv4 address space than classful method with CIDR network and arbitrary length (within the allocated size of ISP's address space)
IPv4 NAT (Network Address Translation):
- Allows an organization to use a smaller number of public IP addresses with the use of private IP addresses; maps one external IP address to many internal IP addresses