A NETWORK is two or more computers or devices that are linked in order to share information. Networks are broken into different subsets based on their size and function. The OSI (Open Systems Interconnection) model provides a conceptual framework for understanding network functions. The OSI Model was developed in the 1970s and 1980s, and it is a conceptual model that breaks networking into seven separate layers. Each layer refers to a set of functions that are responsible for specific tasks. In the OSI model, the definition of the application layer is narrower in scope. The OSI model defines the application layer as only the interface responsible for communicating with host-based and user-facing applications. OSI then explicitly distinguishes the functionality of two additional layers, the session layer and presentation layer, as separate levels below the application layer and above the transport layer. OSI specifies a strict modular separation of functionality at these layers and provides protocol implementations for each. In contrast, the Internet Protocol Suite compiles these functions into a single layer.
The processes of encapsulation and de-encapsulation work in exactly the same way with the TCP/IP model as they do with the OSI model. At each layer of the this models a header is added during Data_encapsulation, and removed during Data_de-encapsulation.
OSI Model - 7 Layers with Data Encapsulation:
Figure: OSI Model showing data encapsulation (adding headers at each layer) on the sender side and de-encapsulation (removing headers) on the receiver side. Each layer has a specific Protocol Data Unit (PDU) name.
The Physical, and lowest layer of the model, covers how unstructured data, like bits, is transmitted. Over these wires and signals, the raw data bits are received as a stream of 0s and 1s. Fixing errors that occur just at this layer means considering physical damage or interference. Some concrete examples of this are the ways wires are configured, the way signals are transferred over those wires, and the radio frequencies computers use. Technology such as WiFi, Bluetooth, and cable standards such as CAT5 and CAT6 all operate at this layer. This layer also includes the hardware part of modems, adapters, and repeaters.
The Data Link layer covers how data is sent from device to device when they are connected on the same local network.
The Network layer describes how data packets are routed between wider networks such as the Internet. Data packet at the network layer is routed from a source IP address to a destination IP address via Domain Name System.
Layers 1 through 3 of the OSI Model are concerned with addressing, packet forwarding, and delivery, establishing basic connectivity. Layer 4, the Transport Layer, focuses on providing the transport services that network applications depend upon. The Transport layer refers to how data is actually transferred. The transport layer handles how the data(files, media, etc) from user/client are split (segmentation), the rate at which the packets are sent, and how errors are handled if data packets don’t make it to the site’s server. The most common transport protocols on the Internet are TCP (Transmission Control Protocol) and UDP (User Datagram Protocol).
TCP Three-Way Handshake - Connection Establishment:
Figure: TCP three-way handshake for connection establishment. Client sends SYN, server responds with SYN-ACK, client sends final ACK. Connection state progresses from SYN_SENT → SYN_RECEIVED → ESTABLISHED. TCP ensures reliable, ordered data delivery through sequence numbers and acknowledgments.
When two computers or devices have established connection / started an exchange of information, we call that a session. The Session layer in OSI is responsible for opening, closing, and maintaining sessions. In terms of opening and closing, the session layer includes authentication and authorization measures. For example, without logging in or having the right permissions, you may not be able to connect to parts of a website. But if you are logged in, your access permission is stored for a set amount of time, or session length.
The Presentation layer includes all the methods that convert data into a format usable by an application⬇️. This layer handles functions such as encoding/decoding, encryption/decryption, and compression/decompression of files.
The application layer of the OSI model essentially provides networking options to programs running on a computer. It works almost exclusively with applications, providing an interface for them to use in order to transmit data. The final layer of the OSI model is the Application layer. This layer includes websites, browsers, email, mobile applications, and how they render Internet data so that we can interact with it.
In the Internet protocol suite, the application layer contains the communications protocols and interface methods used in process-to-process communications across an Internet Protocol (IP) computer network. The application layer only standardizes communication and depends upon the underlying transport layer protocols to establish host-to-host data transfer channels and manage the data exchange in a client–server or peer-to-peer networking model. Though the TCP/IP application layer does not describe specific rules or data formats that applications must consider when communicating, the original specification (in RFC 1123) does rely on and recommend the robustness principle for application design. You will hear more often about the TCP/IP model, which is a 4-Abstraction layered model that makes direct reference to current Internet implementations. Its foundational protocols are TCP and IP.
| Feature | OSI Model | TCP/IP Model |
|---|---|---|
| Layers | 7 Layers | 4 or 5 Layers (Network Access, Internet, Transport, Application) |
| Purpose | Conceptual framework, standardized design | Practical, industry-standard, widely implemented |
| Development | Developed by ISO | Developed by ARPA (DOD) |
| Reliability | Connection-oriented (Transport), Connection-less (Network) can be implemented | Both connection-oriented (TCP) and connectionless (UDP) options |
| Protocols | Protocol independent | Protocols are built into the model |
| Focus | Clear separation of services, interfaces, protocols | Less strict separation, more flexible |
| Relevance | Primary reference model for understanding networking | Practical model for Internet communication |
| Interoperability | More rigid due to strict layering | More adaptable, easier for cross-platform communication |
| Security | Security considerations at all layers (conceptual) | Security often implemented at specific layers (e.g., IPSec at Network) |
TCP/IP Model vs OSI Model Layer Mapping:
Figure: Comparison of OSI 7-layer model with TCP/IP 4-layer model. TCP/IP combines OSI's Application, Presentation, and Session layers into a single Application layer, and merges Physical and Data Link into the Network Access layer.
This layer emcompasses group of methods and communications protocols confined to the link that a host is physically connected to i.e the physical interface between the host system and the network hardware. It defines how data packets are to be formatted for transmission and routings. The link is the physical and logical network component used to interconnect hosts or nodes in the network and a link protocol is a suite of methods and standards that operate only between adjacent network nodes of a network segment. The link layer includes the protocols that define communication between local (on-link) network nodes which fulfill the purpose of maintaining link states between the local nodes, such as the local network topology, and that usually use protocols that are based on the framing of packets specific to the link types.
The goal of this layer is to provide reliable communications between hosts connected on a network. Some of the services provided by this layer of the network stack include.
Data Framing - Breaking up the data stream into individual frames in packets. Data frames are groups of data bits at the Link layer that need to be routed to the correct physical location.
Checksums - Sending checksum data for each frame to enable the receiving node to determine whether or not the frame was received error-free/Corruption-free via Frame Check Sequence
Acknowledgment - Sending either a positive (data was received) or negative (data was not received but expected) acknowledgement from receiver to sender to ensure reliable data transmission.
Flow Control - Buffering data transmissions to ensure that a fast sender does not overwhelm a slower receiver.
Includes Various Protocols such as Wired Ethernet IEEE802.3, Wireless LAN IEEE802.11(WIFI), Neighbor Discovery Protocol(NDP), Secure Neighbor Discovery (SEND), Gratuitous ARP(GARP), Point-to-point Protocol(PPP), Media Access Control Protocols I.e Carrier-sense multiple access with collision detection (CSMA/CD) is a media access control (MAC) method used most notably in early Ethernet technology for local area networking. It uses carrier-sensing to defer transmissions until no other stations are transmitting. This is used in combination with collision detection in which a transmitting station detects collisions by sensing transmissions from other stations while it is transmitting a frame. When this collision condition is detected, the station stops transmitting that frame, transmits a jam signal, and then waits for a random time interval before trying to resend the frame. CSMA/CD is a modification of pure carrier-sense multiple access (CSMA). CSMA/CD is used to improve CSMA performance by terminating transmission as soon as a collision is detected, thus shortening the time required before a retry can be attempted.
In Internet Protocol (IP) networks, the MAC address of an interface corresponding to an IP address may be queried with the Address Resolution Protocol (ARP) for IPv4 and the Neighbor Discovery Protocol (NDP) for IPv6, It routes data frames to the correct physical/MAC addresses. A switch (could be your computer or router) keeps track of local devices and their MAC addresses and makes sure data frames get to the correct physical location. Also Reverse Address Resolution Protocol(RARP) Operates here.
This particular layer has several unique security vulnerabilities that can be exploited by a determined adversary.
Wired Networks
✔️ Content Address Memory(CAM)/ MAC Address table exhaustion attack
✔️ Address Routing Protocol(ARP) spoofing
✔️ Dynamic Host Config Protocol(DHCP) starvation
Wireless Networks
✔️ Hidden Node Attack
✔️ De-auth(De-authentication) Attack
Is a Layer of group of Internetworking methods(concepts of connecting multiple networks with each other via gateways), protocols & specifications that are used to transport network packets(IP-based packets) from the ordination host across network boundaries, If necessary to the destination host specified by an Internet protocol address put simply, This is where IP Logical Addressing system and Routing occur. A common design aspect in the internet layer is the robustness principle: "Be liberal in what you accept, and conservative in what you send"
In its operation as a connectionless protocol, the internet layer is not responsible for reliable transmission. It provides only an unreliable service, and best effort delivery. This means that the network makes no guarantees about the proper arrival of packets. This in accordance with the end-to-end principle. Since packet delivery across diverse networks is an inherently unreliable and failure-prone operation, the burden of providing reliability was placed with the end points of a communication path, i.e., the hosts, rather than on the network. This is one of the reasons of the resiliency of the Internet against individual link failures and its proven scalability. The aspect of data integrity function of providing reliability of service is the duty of higher level protocols, such as the (TCP) in the transport layer.
The internet layer has three basic functions: Routing: Is the forwarding of packets from a source host to the next router that is one hop closer to the intended destination host on another network through gateways. For outgoing packets, select the next-hop host (gateway) and transmit the packet to this host by passing it to the appropriate link layer implementation. For incoming packets, capture packets and pass the packet payload up to the appropriate transport layer protocol, if appropriate. Provide Error Detection & Diagnostic Capability. Usually through Internet Control Message Protocol(ICMP) & Internet Group Management Protocol(IGMP)
The transport layer is responsible for delivering data to the appropriate application process on the host computers. The services in this layer are conveyed to an Application Programming Interface through the transport layer protocols, Their services may include the following features. ✔️Connection-Oriented Communication ✔️Same Order Delivery ✔️Reliability through error-detection code I.e Checksum, SYN/ACK ✔️Flow Control Management ✔️Traffic Congestion Avoidance ✔️Multiplexing==>Ports providing multiple endpoints on single node. *Transport Layer Protocols includes also UDP-lite Reliable UDP(RUDP) Multipath TCP Stream Control Transmission Protocol(SCTP) Datagram Congestion Control Protocol(DCCP)
At this layer, the TCP/IP protocol suite defines how different applications on separate hosts establish connections and track communications. Understanding how protocols use ports to establish connections is critical for configuring and supporting network services. Protocols at the Transport layer are concerned with the delivery of multiplexed application data.
A TCP/IP host may be running multiple services/applications or communicating in parallel with multiple servers, clients, and peers. This means that incoming packets must be directed to the appropriate service or application. To facilitate this, each TCP/IP application type is assigned a unique identifier called a Port Number.
A Socket is a software process that identifies a specific endpoint for communication. A connection is formed when a client requests a service from a server using a combination of IP address and port number.
Client IP:Client PORT (e.g., 192.168.1.10:51234)Server IP:Server PORT (e.g., 192.168.1.1:80)A server socket can support multiple connections from a number of client sockets, and a client may open multiple connections to the same server port. Each combination of Source Socket and Destination Socket forms a separate connection, listed in the host's State Table. Server replies are directed to the ephemeral (client) port that opened the connection, allowing data to be received by the correct application on the client.
This includes the opening and closing of sessions, translating data, and the interaction with content at the application level. Here, there are multiple protocols for web content, email, and accessing files, including HTTP, FTP, SMTP, and more.
The Transmission Control Protocol provides a communication service at an intermediate level between an Application program & the Internet Protocol. It provides host-to-host connectivity at the transport layer of the Internet model. At the transport layer, TCP handles all handshaking and transmission details and presents an abstraction of the network connection to the application typically through a network socket interface.
At the lower levels of the protocol stack(I.e IP), due to network congestion, traffic load balancing, or unpredictable network behaviour, IP packets may be lost, duplicated, or delivered out of order. TCP detects these problems, requests re-transmission of lost data, rearranges out-of-order data and even helps minimize network congestion to reduce the occurrence of the other problems. If the data still remains undelivered, the source is notified of this failure. Once the TCP receiver has reassembled the sequence of octets originally transmitted, it passes them to the receiving application. Thus, TCP abstracts the application's communication from the underlying networking details.
TCP is optimized for accurate delivery rather than timely delivery and can incur relatively long delays (on the order of seconds) while waiting for out-of-order messages or re-transmissions of lost messages. TCP is a reliable stream delivery service which guarantees that all bytes received will be identical and in the same order as those sent. Since packet transfer by many networks is not reliable, TCP achieves reliability using a technique known as Selective Acknowledgement(SACK) with Re-Transmission or Duplicate Cumulative Acknowledgements (DupAcks) with Retransmission Timeout(RTO). This requires the receiver to respond with an acknowledgement message as it receives the data. The sender keeps a record of each packet it sends and maintains a timer from when the packet was sent. The sender re-transmits a packet if the timer expires before receiving the acknowledgement. The timer is needed in case a packet gets lost or corrupted.
While IP handles actual delivery of the data, TCP keeps track of segments - the individual units of data transmission that a Data Stream is divided into for efficient routing through the network. Processes transmit data by calling on the TCP and passing buffers/streams of data as arguments. The TCP packages the data from these buffers into segments and calls on the internet module [e.g. IP] to transmit each segment to the destination TCP. For example, when an HTML file is sent from a web server, the TCP software layer of that server divides the file into segments and forwards them individually to the internet layer in the network stack. The internet layer software(IP) encapsulates each TCP segment into an IP packet by adding a header that includes (among other data) the destination IP address. When the client program on the destination computer receives them, the TCP software in the transport layer re-assembles the segments and ensures they are correctly ordered and error-free as it streams the file contents to the receiving application.
Transmission Control Protocol is a connection-oriented protocol and requires handshaking to set up end-to-end communications. Once a connection is set up, user data may be sent bi-directionally over the connection. User Datagram Protocol is a simpler message-based connectionless protocol. Connectionless protocols do not set up a dedicated end-to-end connection. Communication is achieved by transmitting information in one direction from source to destination without verifying the readiness or state of the receiver. Reliable – TCP manages message acknowledgment, retransmission and timeouts. Multiple attempts to deliver the message are made. If data gets lost along the way, data will be re-sent. In TCP, there's either no missing data, or, in case of multiple timeouts, the connection is dropped. Unreliable – When a UDP message is sent, it cannot be known if it will reach its destination; it could get lost along the way. There is no concept of acknowledgment, retransmission, or timeout. Ordered – If two messages are sent over a connection in sequence, the first message will reach the receiving application first. When data segments arrive in the wrong order, TCP buffers the out-of-order data until all data can be properly re-ordered and delivered to the application. Not ordered – If two messages are sent to the same recipient, the order in which they arrive cannot be guaranteed. Heavyweight – TCP requires three packets to set up a socket connection, before any user data can be sent. TCP handles reliability and congestion control. Lightweight – There is no ordering of messages, no tracking connections, etc. It is a very simple transport layer designed on top of IP. Streaming – Data is read as a byte stream, no distinguishing indications are transmitted to signal message (segment) boundaries. Datagrams – Packets are sent individually and are checked for integrity on arrival. Packets have definite boundaries which are honored upon receipt; a read operation at the receiver socket will yield an entire message as it was originally sent. TCP is used extensively by many internet applications, including the World Wide Web (WWW),HTTP email, File Transfer Protocol, Secure Shell, peer-to-peer file sharing, and streaming media. No congestion control – UDP itself does not avoid congestion. Congestion control measures must be implemented at the application level or in the network. Broadcasts – being connectionless, UDP can broadcast - sent packets can be addressed to be receivable by all devices on the subnet. Multicast – a multicast mode of operation is supported whereby a single datagram packet can be automatically routed without duplication to a group of subscribers.
The use of sequencing, acknowledgments, and retransmission means that TCP requires numerous header fields to keep track and maintain state information. A TCP segment encapsulates application layer data.
| Field Name | Size (Bytes) | Description |
|---|---|---|
| Source Port | 2 | Identifies the sending application. |
| Destination Port | 2 | Identifies the receiving application. |
| Sequence Number (Seq #) | 4 | The identification of the first byte of the current segment in the data stream. Allows the receiver to reassemble messages correctly and deal with out-of-order packets. |
| Acknowledgment Number (Ack #) | 4 | The Sequence Number of the next segment expected from the other host (i.e., the Sequence Number of the last segment received +1). Lack of acknowledgment (due to delays) or Negative Acknowledgment (NACK for lost/damaged packets) forces retransmission. |
| Data Offset | 4 bits | Specifies the size of the TCP header. |
| Reserved | 6 bits | Reserved for future use. |
| Flags | 1 byte | Contains control bits such as ACK (Acknowledgment), SYN (Synchronize sequence numbers - for connection initiation), FIN (Finish - for connection termination), RST (Reset - for abrupt termination). |
| Window | 2 | The amount of data the host is willing to receive before sending another acknowledgment. This is a key part of TCP's flow control mechanism. |
| Checksum | 2 | Ensures the validity of the segment. Calculated on the value of not only the TCP header and payload but also part of the IP header. |
| Urgent Pointer | 2 | If urgent data is being sent, this specifies the end of that urgent data within the segment. |
| Options | Variable | Allows further connection parameters to be configured. The most important is Maximum Segment Size (MSS), which allows the host to specify how large the segments it receives should be, minimizing fragmentation as they are transported over data link frames. |
A TCP connection is established using a Three-Way Handshake:
A host can end a session gracefully using a Four-Way Handshake (involving FIN and ACK flags from both sides). A host can also end a session abruptly using an RST (Reset) flag, typically indicating an error, failure, or suspicious activity. The server expects regular acknowledgments for segments it sends. If a timeout occurs without an acknowledgment, it means the information didn't arrive, and the server automatically resends that segment. This overhead makes TCP suitable when reliability and integrity are paramount, even if it results in slightly slower transmission.
User/Unreliable Datagram Protocol UDP uses a simple connectionless communication model with a minimum of protocol mechanisms where Prior communications are not required in order to set up communication channels or data paths. UDP provides checksums for data integrity, and port# for addressing different functions at the source and destination of the datagram. It has no handshaking dialogues, and thus exposes the user's program to any unreliability(no Assurance) of the underlying network; there is no guarantee of delivery, ordering, or duplicate protection. While these are certainly drawbacks for some types of applications, other applications that want to prioritize transmission speed and efficiency over security and reliability may leverage UDP. UDP is suitable for purposes where error checking and correction are either not necessary or are performed in the application; UDP avoids the overhead of such processing in the protocol stack. Time-sensitive applications often use UDP because dropping packets is preferable to waiting for packets delayed due to retransmission, which may not be an option in a real-time system In order to remedy the security issue, encryption protocols are commonly used. Lacking reliability, UDP applications must be willing to accept some packet loss, reordering, errors or duplication. If using UDP, the end user applications must provide any necessary handshaking such as real time confirmation that the message has been received. A number of UDP's attributes make it especially suited for certain applications. ✔️It is transaction-oriented, suitable for simple query-response protocols where queries must be fast and only consist of a single request followed by a single reply packet I.e Domain Name System or the Network Time Protocol. ✔️It provides datagrams, suitable for modeling other protocols such as IP tunneling or remote procedure call and the Network File System. ✔️ It is simple, suitable for bootstrapping or other purposes without a full protocol stack, such as the DHCP and Trivial File Transfer Protocol. ✔️It is stateless, suitable for very large numbers of clients, such as in streaming media applications such as IPTV. ✔️The lack of retransmission delays makes it suitable for real-time applications such as Voice over IP, online games, and many protocols using Real Time Streaming Protocol. ✔️Because it supports multicast, it is suitable for broadcast information such as in many kinds of service discovery and shared information such as Precision Time Protocol and Routing Information Protocol.
Unlike TCP, UDP is a Connectionless, Non-Reliable method of communication with no acknowledgments or built-in flow control.
A UDP header is only 8 bytes, consisting of:
The unit of data packets transferred between hosts using this protocol is referred to as a Datagram. No prior communications are required to set up communication channels or data paths, which is characteristic of Connectionless protocols (no handshake dialogue). This design exposes the user's program to the unreliability of the underlying network.
TLS (Transport Layer Security) is the successor to the deprecated Secure Sockets Layer (SSL). It is a cryptographic protocol designed to provide communication security over computer networks. TLS runs in the Application Layer of the Internet protocol suite. It is composed of two layers: the TLS Record Protocol and the TLS Handshake Protocol. Transport Layer Security TLS is a widely adopted cryptographic security protocol designed to facilitate secure data transmission via encryption. TLS evolved out of the encryption protocol known as SSL (Secure Sockets Layer), which has since been deprecated in favor of TLS. While these two protocols are different, the terms are sometimes used interchangeably. Using TLS with HTTP will allow you to use HTTPS (Hypertext Transfer Protocol Secure), which helps denote the presence of the extra security. Once the client and server have agreed to use TLS, they negotiate a stateful connection by using a handshaking procedure. The protocols use a handshake with an Asymmetric Encryption cipher (Initial Handshake/Hello Phase Cipher Suites) to establish not only cipher settings but also a session-specific shared key with which further communication is encrypted using a Symmetric cipher. During this handshake, the client and server agree on various parameters used to establish the connection's security:
In addition to the above, careful configuration of TLS can provide additional privacy-related properties such as forward secrecy, ensuring that any future disclosure of encryption keys cannot be used to decrypt any TLS communications recorded in the past. TLS supports many different methods for exchanging keys, encrypting data, and authenticating message integrity. As a result, secure configuration of TLS involves many configurable parameters, and not all choices provide all of the privacy-related properties described in the list above (see the tables below § Key exchange, § Cipher security, and § Data integrity). Attempts have been made to subvert aspects of the communications security that TLS seeks to provide, and the protocol has been revised several times to address these security threats. Developers of web browsers have repeatedly revised their products to defend against potential security weaknesses after these were discovered (see TLS/SSL support history of web browsers). *Forward Secrecy is a property of cryptographic systems which ensures that a “session key derived from a set of public and private keys” will not be compromised if one of the private keys is compromised in the future, ensuring that any future disclosure of encryption keys cannot be used to decrypt any TLS communications recorded in the past. *A digital certificate certifies the ownership of a public key by the named subject of the certificate, and indicates certain expected usages of that key. This allows others (relying parties) to rely upon signatures or on assertions made by the private key that corresponds to the certified public key. Keystores and trust stores can be in various formats, such as .pem, .crt, .pfx, and .jks. *Certificate authority TLS typically relies on a set of trusted third-party certificate authorities to establish the authenticity of certificates. Trust is usually anchored in a list of certificates distributed with user agent software. and can be modified by the relying party. *TLS interception (or HTTPS interception if applied particularly to that protocol) is the practice of intercepting an encrypted data stream in order to decrypt it, read and possibly manipulate it, and then re-encrypt it and send the data on its way again. This is done by way of a "transparent proxy": the interception software terminates the incoming TLS connection, inspects the HTTP plaintext, and then creates a new TLS connection to the destination
Clients request that a server sets up a TLS connection, achieved either by:
STARTTLS command) to switch a connection from unencrypted (e.g., port 80 for HTTP) to encrypted.The TLS Handshake is a complex process but can be summarized:
When secure via TLS, connections between client and server offer:
Internet Protocol Security(IPsec) is a suite of protocols defined by RFC 4301, "Security Architecture for the Internet Protocol" for securing IP communications by authenticating, encapsulating & encrypting each IP packet in a data stream. Which has found widespread use in securing virtual private networks. IPsec includes protocols for establishing mutual authentication between agents at the beginning of a session and negotiation of cryptographic keys to use during the session. IPsec can protect data flows between a pair of hosts (host-to-host), between a pair of security gateways (network-to-network), or between a security gateway and a host (network-to-host).
IPsec can be used to secure IPv4 and/or IPv6 communications on local networks and for remote access protocols. Each host that uses IPsec must be assigned an IPsec policy. An IPsec policy sets the authentication mechanism and also the protocols and mode for the connection (Transport / Tunnel). Hosts must be able to match at least one security method for a connection to be established.
The IPsec protocols AH and ESP can be implemented in a host-to-host transport mode, as well as in a network tunneling mode. In computer networks, a tunneling protocol is a communication protocol which allows for the movement of data from one network to another, by exploiting encapsulation. It involves allowing private network communications to be sent across a public network (such as the Internet) through a process called encapsulation. The tunneling protocol works by using the data portion of a packet (the payload) to carry the packets that actually provide the service. Tunneling uses a layered protocol model such as those of the OSI or TCP/IP protocol suite, but usually violates the layering when using the payload to carry a service not normally provided by the network. Typically, the delivery protocol operates at an equal or higher level in the layered model than the payload protocol. According to the definition of tunneling, one can use it to access resources that are available only to internal networks. To create/facilitate such tunnels, an appropriate application should be used. The most known one is SSH
Transport Mode:
Tunnel Mode:
Encapsulation is a generic networking concept that involves wrapping one protocol's payload inside another so it can be transmitted across a network. It's used for routing and transporting data, but not by default for security or encryption. Examples include an IPv6 packet over an IPv4 network (6 to 4 Tunneling and Encapsulation), and Generic Routing Encapsulation (GRE) which wraps Layer 3 traffic inside IP packets with no mechanism for authentication. Tunneling is a more specific use case of Encapsulation, which refers to Encapsulating and Routing packets through a "TUNNEL". IPsec VPN tunnels traffic with encryption, while GRE tunnels traffic without encryption. All Tunneling involves Encapsulation, but not all Encapsulation is Tunneling (e.g., MPLS and GRE). Also, not all tunnels are Encrypted (e.g., L2TP and GRE). Tunneling may or may not imply encryption. IPsec doesn't support Broadcast & Multicast traffic, only Unicast. To SUMMARIZE:
IP Header | AH Header | TCP/UDP Header | PayloadIP Header | ESP Header | TCP/UDP Header | Payload | ESP Trailer | ESP Authentication DataIPsec's encrypting and hashing functions depend on shared secrets. The secrets must be communicated to both hosts, and the hosts must confirm one another's identity (mutual authentication). The Internet Key Exchange (IKE) protocol handles authentication and key exchange, establishing the Security Association (SA). Most IPsec implementations consist of an IKE daemon that runs in user space and an IPsec stack in the kernel that processes the actual Internet Protocol packets.
Tunneling involves encapsulating one protocol's packets within another protocol's packets to carry them across an incompatible network or to provide secure, logical links.
Traditionally, application and client-suite VPNs require a client application that implements the protocols and authentication methods supported by the VPN gateway.
The canvas element introduced in HTML5 allows modern browsers to draw and update a desktop with relatively little lag, enabling many browsers to act as "clientless" VPN/RDP clients. Also referred to as an HTML5 VPN, this solution uses a protocol called WebSockets, which enables bidirectional messages to be sent between the server and client without requiring the overhead of separate HTTP requests.
Remote host access refers to operating a computer or configuring a network appliance without needing to use a terminal directly connected to it. This can be implemented within a local network or over a public network. (Image Placeholder - Remote Access VPN)
DMVPN is a Cisco-developed solution that allows Routers to dynamically create a full Mesh of IPsec tunnels without having to manually configure every single tunnel. DMVPN provides the configuration simplicity of a Hub and Spoke WAN topology (each Spoke Router only needs one tunnel configured) and the efficiency of direct spoke-to-spoke communication (spoke routers can communicate directly without traffic passing through the Hub (VPN HeadEnd)). They communicate between themselves by a temporary encrypted VPN setup between them by the DMVPN. This process also involves the use of Next Hop Resolution Protocol (NHRP) to identify destination addresses and GRE tunnels to encapsulate the encrypted IPsec packets. DMVPN Configuration Commands • Interface Tunnel 0 • tunnel source "Interface" • tunnel Destination "ip-addr"
❗️Application Programming Interface (API)- A protocol intended to be used as an interface by software components to communicate with each other. ❗️Buffer- A region of a physical memory storage used to temporarily prevent data from continuing while it is being moved from one place to another. ❗️Buffer Underrun- A state occurring when a buffer used to communicate between two devices or processes is fed with data at a lower speed than the data is being read from it. ❗️Checksum- A fixed-size datum computed from an arbitrary block of digital data for the purpose of detecting accidental errors that may have been introduced during its transmission or storage. ❗️Connection Oriented Communication- A data communication mode whereby the devices at the end points use a protocol to establish an end-to-end logical or physical connection before any data may be sent. ❗️Connectionless- A data communication mode in which a message can be sent from one end point to another without prior arrangement. ❗️Data Stream- A sequence of digitally encoded coherent signals (packets of data or data packets) used to transmit or receive information that is in the process of being transmitted. ❗️Datagram- A basic transfer unit associated with a packet-switched network in which the delivery, arrival time, and order of arrival are not guaranteed by the network service. ❗️Deadlock- A situation in which two or more competing actions are each waiting for the other to finish, and thus neither ever does. ❗️Ephemeral Port- A short lived port allocated automatically from a predefined range. ❗️Handshaking- An automated process of negotiation that dynamically sets parameters of a communications channel established between two entities before normal communication over the channel begins. ❗️Latency- A measure of time delay experienced in a system. ❗️Maximum segment size (MSS)- A parameter of the TCP protocol that specifies the largest amount of data that a computer or communications device can receive in a single TCP segment. ❗️Multiplexing- A method by which multiple analog message signals or digital data streams are combined into one signal over a shared medium. ❗️Network Congestion- A data communication situation in which a link or node is carrying so much data that its quality of service deteriorates. ❗️Registered Port- A transport protocol port assigned by the Internet Assigned Numbers Authority (IANA) for use with a certain protocol or application. ❗️Reliability- A reliable protocol is a communication protocol that notifies the sender whether or not the delivery of data to intended recipients was successful with respect to the delivery of data to the intended recipient(s), as opposed to an unreliable protocol, which does not provide notifications to the sender as to the delivery of transmitted data. ❗️Slow start- One of the algorithms that TCP uses to control congestion inside the network, in which the TCP window size is increased each time an acknowledgment is received. ❗️TCP window scale option- An option to increase the TCP receive window size above its maximum value of 65,535 bytes ❗️Ports- A port is a software structure that is identified by the port number, a 16 bit integer value, allowing for port numbers between 0 and 65535. Applications can use datagram sockets to establish host-to-host communications. An application binds a socket to its endpoint of data transmission, which is a combination of an IP address and a port. In this way, UDP provides application multiplexing. Port 0 is reserved, but is a permissible source port value if the sending process does not expect messages in response. ❗️Packet Retransmission(PAR)- is the resending of packets which have been either damaged or lost. Retransmission is one of the basic mechanisms used by protocols operating over a packet switched computer network to provide reliable communication. Networks are usually "unreliable", meaning they offer no guarantees that they will not delay, damage, or lose packets, or deliver them out of order. Protocols which provide reliable communication over such networks use a combination of acknowledgments & Retransmission of missing or damaged packets (usually initiated by a time-out), and checksums to provide that reliability. *Positive Acknowledgment ACK *Negative Acknowledgment NACK *Selective Acknowledgments SACK *Cumulative Acknowledgments CACK ❗️Automatic repeat request (ARQ), also known as automatic repeat query, is an error-control method for data transmission that uses acknowledgements (messages sent by the receiver indicating that it has correctly received a packet) and timeouts (specified periods of time allowed to elapse before an acknowledgment is to be received) to achieve reliable data transmission over an unreliable communication channel. If the sender does not receive an acknowledgment before the timeout, it re-transmits the packet until it receives an acknowledgment or exceeds a predefined number of retransmissions. The ARQ protocol also provides flow control, which may be combined with congestion avoidance. Variations of ARQ protocols include *Stop-and-wait ARQ *Go-Back-N ARQ *Selective Repeat ARQ