Communication Models
UDP/TCP
While TCP focuses on reliability and comprehensive data communication, UDP aims for speed and simplicity.
A TCP packet is called a segment and a UDP packet is called a datagram.
The choice between TCP and UDP will largely depend on the needs of the specific application in question.
Feature | TCP | UDP | Use Case for TCP | Use Case for UDP |
Connection type | Connection-based | Connection-less | Web browsing (HTTP/HTTPS): Ensuring a consistent and reliable connection during browsing sessions is essential. | Video conferencing: Quick, real-time data transfer where a slight data loss can be tolerated. |
Data transfer method | Byte stream | Message based | File Transfer (FTP): Reliable transmission of large files byte-by-byte. | DNS queries: Quick individual requests and responses without establishing a prolonged connection. |
Multicast/broadcast support | No | Yes | Not generally needed for use cases like financial transactions where individual security and reliability is crucial. | Online gaming: Broadcasting game state to all players simultaneously. |
Full duplex transmission | Yes | No | Email (SMTP): Bi-directional communication for sending and receiving emails. | Not typically needed for tasks like streaming where primary focus is one-directional data flow. |
Reliability | Reliable | Unreliable | Financial transactions: Ensuring every transaction is confirmed and recorded without any loss. | Video streaming: Smooth playback prioritizes real-time experience over guaranteed delivery. Some frame drops are acceptable. |
Error correction & flow control | Yes | No | Large file downloads: Error checks ensure file integrity and completeness. | Voice over IP (VoIP): Focuses on speed and low latency rather than ensuring every piece of data is perfectly transmitted. |
TCP (Transmission Control Protocol)
-
Connection-oriented: Before data transfer begins, a handshake establishes a connection between sender and receiver.
-
Reliable: Ensures that data is delivered to the receiving system accurately and in order. If any packets are lost or corrupted during transmission, TCP will retransmit them.
-
Flow Control: Manages data transmission between devices to prevent fast senders from overwhelming slow receivers.
-
Error Checking: Contains mechanisms to check if data was sent and received correctly.
-
Ordered Packets: If two messages are sent over a connection in sequence, the first message will reach the receiving application before the second.
-
Use Cases: Ideal for applications where data integrity and order are critical, like web browsers, file transfers, and email.
Think of TCP as making a phone call — you establish a connection, ensure the other party can hear you clearly, and then carry on a conversation.
UDP (User Datagram Protocol)
-
Connectionless: No initial handshake or connection establishment. Data is sent as soon as it's ready.
-
Unreliable: Doesn't guarantee delivery, order, or error-checking of packets. Data might be lost, duplicated, or arrive out of order.
-
No Flow Control: Doesn't manage pacing, so if the receiving system is overwhelmed, it will simply drop packets.
-
Lightweight: Due to the absence of connection setup and error-checking, UDP often has lower latency.
-
Use Cases: Suitable for situations where speed is more critical than accuracy, like streaming video or online gaming. Also used in simple query/response protocols like DNS.
Think of UDP as dropping a letter in the mailbox — it'll probably get there, but there's no guarantee, and no way to know if it was read.
Common TCP/UDP ports
Protocol | TCP/UDP | Port |
FTP: File Transfer Protocol | TCP | 20/21 |
SSH: Secure Shell | TCP | 22 |
SMTP: Simple Mail Transfer Protocol | TCP | 25 |
DNS: Domain Name System | TCP/UDP | 53 |
DHCP: Dynamic Host Configuration | UDP | 67/68 |
TFTP: Trivial File Transfer Protocol | UDP | 69 |
HTTP: Hypertext Transfer Protocol | TCP | 80 |
POP3: Post Office Protocol | TCP | 110 |
NTP: Network Time Protocol | UDP | 123 |
NetBIOS | TCP/UDP | 137/138/139 |
IMAP: Internet Message Access Protocol | TCP | 143 |
SNMP: Simple Network Management Protocol | TCP/UDP | 161/162 |
BGP: Border Gateway Protocol | TCP | 179 |
LDAP: Lightweight Directory Access Protocol | TCP/UDP | 389 |
HTTPS: HTTP over SSL/TLS | TCP | 443 |
LDAP over TLS/SSL | TCP/UDP | 636 |
FTP over TLS/SSL | TCP | 989/990 |
The OSI Model
Layer, Name | Functionality Overview | Protocols |
7. Application (All) | Provides application services directly to end- |
SSH, HTTP, FTP, LPD, SMTP, Telnet, TFTP, EDI, POP3, IMAP, SNTP, NNTP, S-RPC, SET |
6. Presentation (People) | Translates data between the application and transport layers. Handles encryption, compression, and translation | ASCII, EBCDIC, TIFF, JPEG, MPEG, MIDI |
5. Session (Seem) | Establishes, manages, and terminates connections between |
SMB, RPC, NFS, SQL |
4. Transport (To) | Provides reliable data transport between hosts. (segment or datagram) | SPX, SSL, TLS, TCP, UDP, SCTP |
3. Network (Need) | Routes data from the source to the destination in a packet. | ICMP, RIP, OSPF, BGP, IGMP, IP, IPSec, IPX, Nat, SKIP |
2. Data Link (Data) | Packages bits from the physical layer into frames and handles error detection | Ethernet, Frame Relay, ARP, SLIP, PPP, L2P, L2TP, PPTP, FDDI, ISDN |
1. Physical (Processing) | Transmits raw bit stream over physical medium. Can also have drivers that tell the protocol how to use the hardware transmitting the stream. | EIA/TIA-232, EIA/TIA-449, X.21, HSSI, SONET, V.24, V.35, Bluetooth, 802.11 - Wi-Fi, USB, IEEE 802.3 (Ethernet specs) |
TCP/IP Stack vs OSI
TCP/IP Protocol Stack | OSI Reference Model | |
Application |
➡️ ⬅️ |
Application |
Presentation | ||
Session | ||
Transport |
➡️ ⬅️ |
Transport |
Internet |
➡️ ⬅️ |
Network |
Application |
➡️ ⬅️ |
Application |
➡️ ⬅️ |
Presentation |
Cabling Types & Throughput
UTP Categories - Copper Cable
UTP, which stands for Unshielded Twisted Pair, refers to a type of cable construction rather than a specific kind of data communication.
Cat | Data Rate | Max Length | Time | Application |
---|---|---|---|---|
Cat 3 | 10 Mbps | 100 meters | Early 1990s | 10BASE-T Ethernet (Original Ethernet) and voice services, Token Ring |
Cat 5 | 100 Mbps | 100 meters | Mid 1990s | 100BASE-TX Ethernet (FastEthernet), Token Ring |
Cat 5e | 1 Gbps | 100 meters | Late 1990s | 1000BASE-T (Gigabit Ethernet) and 100BASE-TX |
Cat 6 | 1 Gbps (10 Gbps up to 55m) | 100 meters | Early 2000s | 1000BASE-T (Gigabit Ethernet) and 10GBASE-T (short distances), |
Cat 6a | 10 Gbps | 100 meters | Late 2000s | 10GBASE-T (10 Gigabit Ethernet) |
Cat 7 | 10 Gbps | 100 meters | 2010s | 10GBASE-T for more industrial applications |
Cat 7a | 40 Gbps (up to 50m) / 100 Gbps (up to 15m) | 100 meters | Mid-2010s | High-speed data centers and 10GBASE-T |
Cat 8 | 25-40 Gbps | 30 meters | Late 2010s | Data centers for 25GBASE-T and 40GBASE-T |
While UTP is commonly associated with Ethernet networking because of its widespread use in this application, the construction itself is not exclusive to Ethernet.
Ethernet Standards
Ethernet Standard | Max Speed | Max Distance | Installation Difficulty | Susceptibility to EMI |
---|---|---|---|---|
10BASE2 | 10 Mbps | 185 meters | Moderate | Medium |
10BASE5 | 10 Mbps | 500 meters | Hard | Low |
10BASE-T (UTP) | 10 Mbps | 100 meters | Easy | High |
STP | 155 Mbps | 100 meters | Moderate | Low |
100BASE-T/100BASE-TX | 100 Mbps | 100 meters | Easy | Moderate |
1000BASE-T | 1 Gbps | 100 meters | Easy | Moderate to Low |
Fiber-optic | 2+ Gbps | 2000+ meters | Hard | Very Low |
Notes on Installation Difficulty and Susceptibility to EMI:
-
10BASE2 (Thinnet): Requires BNC connectors and terminators, making it more cumbersome than UTP installations.
-
10BASE5 (Thicknet): Its nickname "Thicknet" suggests its bulkiness. Requires AUI connectors, making installation more difficult than Thinnet or UTP.
-
UTP (like for 10BASE-T): Generally easier to install, but more susceptible to EMI compared to shielded or coaxial cables.
-
STP: Provides some shielding against EMI. It can be slightly more challenging to install than UTP due to the shielding and the need to ground.
-
Fiber-optic: Installation is difficult due to the precision required when handling and connecting fibers. However, they offer the best protection against EMI since light signals are immune to electromagnetic interference.
Network Standard Topologies
Mesh Topology
Description: Every system is connected to every other system, providing multiple paths for data transmission.
-
Types:
- Full Mesh: Every node connects to every other node. Common in critical networks like bank networks.
- Partial Mesh: Some nodes are connected to all others, but some only to a few. Useful when full mesh is too costly or complex.
-
Advantages:
- High Redundancy: Ensures data transmission even if some connections fail.
- Fault Tolerance: Can handle multiple failures without affecting connectivity.
-
Example Hardware/Software:
- BitTorrent. When you download files via BitTorrent, your computer connects to multiple other computers that have the same file. There's no central server. Each computer (or peer) shares a piece of the file with each other.
- Cryptocurrencies like Bitcoin and Ethereum utilize blockchain technology
Mesh topology is prevalent in WANs, such as the Internet backbone, where constant connectivity is crucial.
Ring Topology
Description: Systems are connected in a circular fashion. Data often travels in one direction.
-
Traffic Management: A 'token' system is utilized to prevent collisions and manage traffic.
-
Example Hardware/Software:
- IBM's Token Ring network in the past used MAUs (Multistation Access Units) as a hardware device to create and maintain the ring topology.
- FDDI (Fiber Distributed Data Interface): Another ring-based technology, but focused on fiber optics.
Ring topologies have become less common due to technological advances and maintenance challenges.
Bus Topology
Description: All devices share a single communication line or 'bus'.
-
Functionality: Possible data collisions if multiple devices transmit simultaneously.
-
Example Hardware/Software:
- 10Base2 (Thin Ethernet) and 10Base5 (Thick Ethernet): Ethernet standards that used coaxial cables in bus topology.
- BNC connectors and T-connectors were standard for attaching devices to the bus in 10Base2 networks.
Collisions such as in early Ethernet setups, can hinder network performance. Today, this design is largely obsolete.
Star Topology
Description: All devices connect to a central hub or switch.
-
Advantages:
- Ease of Installation & Maintenance: Simplified troubleshooting and scalability.
- Isolation of Devices: Individual device failures don't cripple the whole network.
Example Hardware/Software:
- Ethernet switches (e.g., Cisco Catalyst switches, Netgear ProSafe switches): Modern devices that intelligently forward data only to the intended recipient.
- Call of Duty's P2P System: Operates like a star topology where one player's system is the central host. All players connect to this host. If the host disconnects, the game briefly pauses for "host migration" to a new player.
Star topology, especially with switches like Cisco's, is predominant in modern LANs due to its robustness and simplicity.
Fibre Channel
Definition: A high-speed network technology primarily used for storage networking.
Key Features:
-
Data Storage Solutions: Typically found in SAN (Storage Area Network) or NAS (Network-Attached Storage) solutions. Fibre Channel is often associated with SANs due to its high-speed capabilities.
-
Transmission Mechanism: Uses fibre channeling to connect storage devices to a switch or network.
FCoE (Fibre Channel over Ethernet)
Definition: A mapping of Fibre Channel frames over Ethernet networks.
Key Features:
-
Encapsulation: Allows Fibre Channel communications to be encapsulated and sent over Ethernet networks.
Success: FCoE combines the robustness of Fibre Channel with the widespread infrastructure of Ethernet.
-
Usage: Typically seen in data center settings to simplify and consolidate networking and storage communication.
iSCSI (Internet Small Computer System Interface)
Definition: An IP-based storage networking standard that links data storage facilities.
Key Features:
-
IP-based: Allows for data transfers over local area networks (LANs), wide area networks (WANs), or the internet.
Information: iSCSI offers an alternative to Fibre Channel, leveraging existing IP infrastructure.
UDP/TCP
While TCP focuses on reliability and comprehensive data communication, UDP aims for speed and simplicity.
A TCP packet is called a segment and a UDP packet is called a datagram.
The choice between TCP and UDP will largely depend on the needs of the specific application in question.
Feature | TCP | UDP | Use Case for TCP | Use Case for UDP |
Connection type | Connection-based | Connection-less | Web browsing (HTTP/HTTPS): Ensuring a consistent and reliable connection during browsing sessions is essential. | Video conferencing: Quick, real-time data transfer where a slight data loss can be tolerated. |
Data transfer method | Byte stream | Message based | File Transfer (FTP): Reliable transmission of large files byte-by-byte. | DNS queries: Quick individual requests and responses without establishing a prolonged connection. |
Multicast/broadcast support | No | Yes | Not generally needed for use cases like financial transactions where individual security and reliability is crucial. | Online gaming: Broadcasting game state to all players simultaneously. |
Full duplex transmission | Yes | No | Email (SMTP): Bi-directional communication for sending and receiving emails. | Not typically needed for tasks like streaming where primary focus is one-directional data flow. |
Reliability | Reliable | Unreliable | Financial transactions: Ensuring every transaction is confirmed and recorded without any loss. | Video streaming: Smooth playback prioritizes real-time experience over guaranteed delivery. Some frame drops are acceptable. |
Error correction & flow control | Yes | No | Large file downloads: Error checks ensure file integrity and completeness. | Voice over IP (VoIP): Focuses on speed and low latency rather than ensuring every piece of data is perfectly transmitted. |
TCP (Transmission Control Protocol)
-
Connection-oriented: Before data transfer begins, a handshake establishes a connection between sender and receiver.
-
Reliable: Ensures that data is delivered to the receiving system accurately and in order. If any packets are lost or corrupted during transmission, TCP will retransmit them.
-
Flow Control: Manages data transmission between devices to prevent fast senders from overwhelming slow receivers.
-
Error Checking: Contains mechanisms to check if data was sent and received correctly.
-
Ordered Packets: If two messages are sent over a connection in sequence, the first message will reach the receiving application before the second.
-
Use Cases: Ideal for applications where data integrity and order are critical, like web browsers, file transfers, and email.
Think of TCP as making a phone call — you establish a connection, ensure the other party can hear you clearly, and then carry on a conversation.
UDP (User Datagram Protocol)
-
Connectionless: No initial handshake or connection establishment. Data is sent as soon as it's ready.
-
Unreliable: Doesn't guarantee delivery, order, or error-checking of packets. Data might be lost, duplicated, or arrive out of order.
-
No Flow Control: Doesn't manage pacing, so if the receiving system is overwhelmed, it will simply drop packets.
-
Lightweight: Due to the absence of connection setup and error-checking, UDP often has lower latency.
-
Use Cases: Suitable for situations where speed is more critical than accuracy, like streaming video or online gaming. Also used in simple query/response protocols like DNS.
Think of UDP as dropping a letter in the mailbox — it'll probably get there, but there's no guarantee, and no way to know if it was read.
Common TCP/UDP ports
Protocol | TCP/UDP | Port |
FTP: File Transfer Protocol | TCP | 20/21 |
SSH: Secure Shell | TCP | 22 |
SMTP: Simple Mail Transfer Protocol | TCP | 25 |
DNS: Domain Name System | TCP/UDP | 53 |
DHCP: Dynamic Host Configuration | UDP | 67/68 |
TFTP: Trivial File Transfer Protocol | UDP | 69 |
HTTP: Hypertext Transfer Protocol | TCP | 80 |
POP3: Post Office Protocol | TCP | 110 |
NTP: Network Time Protocol | UDP | 123 |
NetBIOS | TCP/UDP | 137/138/139 |
IMAP: Internet Message Access Protocol | TCP | 143 |
SNMP: Simple Network Management Protocol | TCP/UDP | 161/162 |
BGP: Border Gateway Protocol | TCP | 179 |
LDAP: Lightweight Directory Access Protocol | TCP/UDP | 389 |
HTTPS: HTTP over SSL/TLS | TCP | 443 |
LDAP over TLS/SSL | TCP/UDP | 636 |
FTP over TLS/SSL | TCP | 989/990 |
The OSI Model
Layer, Name | Functionality Overview | Protocols |
7. Application (All) | Provides application services directly to end-users | SSH, HTTP, FTP, LPD, SMTP, Telnet, TFTP, EDI, POP3, IMAP, SNTP, NNTP, S-RPC, SET |
6. Presentation (People) | Translates data between the application and transport layers. Handles encryption, compression, and translation | ASCII, EBCDIC, TIFF, JPEG, MPEG, MIDI |
5. Session (Seem) | Establishes, manages, and terminates connections between applications | SMB, RPC, NFS, SQL |
4. Transport (To) | Provides reliable data transport between hosts. (segment or datagram) | SPX, SSL, TLS, TCP, UDP, SCTP |
3. Network (Need) | Routes data from the source to the destination in a packet. | ICMP, RIP, OSPF, BGP, IGMP, IP, IPSec, IPX, Nat, SKIP |
2. Data Link (Data) | Packages bits from the physical layer into frames and handles error detection | Ethernet, Frame Relay, ARP, SLIP, PPP, L2P, L2TP, PPTP, FDDI, ISDN |
1. Physical (Processing) | Transmits raw bit stream over physical medium. Can also have drivers that tell the protocol how to use the hardware transmitting the stream. | EIA/TIA-232, EIA/TIA-449, X.21, HSSI, SONET, V.24, V.35, Bluetooth, 802.11 - Wi-Fi, USB, IEEE 802.3 (Ethernet specs) |
TCP/IP Stack vs OSI
TCP/IP Protocol Stack | OSI Reference Model | |
Application |
➡️ ⬅️ |
Application |
Presentation | ||
Session | ||
Transport |
➡️ ⬅️ |
Transport |
Internet |
➡️ ⬅️ |
Network |
Application |
➡️ ⬅️ |
Application |
➡️ ⬅️ |
Presentation |