Complex about simple. Physical layer (L1) of OSI model
Hello, colleagues! My name is ProstoKirReal, and today I want to discuss with you the physical layer (L1) of the OSI model. Understanding this layer is fundamental for anyone just starting out in networking technologies.
❯ What is the physical level?
The Physical Layer is the first and lowest layer of the OSI model. It is responsible for transmitting raw data bits over physical media such as cables and radio waves. This layer defines the electrical, mechanical, procedural, and functional characteristics for activating, maintaining, and deactivating physical connections between end systems.
First, you need to understand what a data bit is. In my first months of work, I was often confused between the concepts of bit and byte.
Bit and byte are the two basic units of measurement of information in computer systems. The difference between them is as follows:
❯ Bit
- Definition: A bit is the smallest unit of information in computer systems.
- Meaning: can take one of two values: 0 or 1. These values are often interpreted as “on” or “off”, “true” or “false”.
- Usage: used to represent binary information and operations at the hardware level.
❯ Byte
- Definition: A byte consists of 8 bits.
- Meaning: can represent 256 different values (0 to 255 in decimal or 00 to FF in hexadecimal).
- Usage: is widely used to represent data, such as characters in text files. For example, each character in the ASCII standard is encoded by one byte.
Approximate comparison:
- Bit: 0 or 1
- Byte: 8 bits (eg 01101010)
There's an old joke to remember:
Stirlitz had a row with a bar patron and went out with him 1 on 1. At the exit he saw 8 people with bits. “One byte equals 8 bits,” thought Stirlitz
Above I wrote about the binary and hexadecimal systems. What are they for?
Various network devices, computers, etc. communicate with each other using the binary system.
What should we, ordinary people, do? Even simple data in binary looks very cumbersome.
For example, the sentence “Hello, world!” looks like 01001000 01100101 01101100 01101100 01101111 00101100 00100000 01110111 01101111 01110010 01101100 01100100 00100001.
To improve the readability of such data arrays, the hexadecimal system is used. For example, the sentence “Hello, world!” looks like 48 65 6C 6C 6F 2C 20 77 6F 72 6C 64 21.
Is it more readable now?
That is, 1 bit is 0, 1 byte is 01001000, in hexadecimal 1 byte is 48.
The hexadecimal number system is a convenient, compact, and widely accepted way to represent binary data in computer networks and other areas of information science. It allows engineers and programmers to work with data efficiently, while providing ease of conversion and improved readability.
❯ Advantages of the hexadecimal system
- Convenience of conversion: simple conversion between hexadecimal and binary systems.
- Brief summary: significantly shorter notations compared to the binary system.
- Increased readability: easier to understand and analyze when working with low-level data.
- Acceptance in standards: widely used in networking and computer standards.
Is it difficult? Just a little more and we'll get to L1.
One more concept that we will need to understand.
❯ Data package
A data packet is a set of information that is transmitted between devices on computer networks. It contains data such as text, images, audio, or video, and information about where the data should be sent from and where it should be sent. Data packets play a key role in transmitting information across networks.
The packet serves us to transfer information from computer to computer. In general, this is a separate topic for discussion, after the OSI model I will write an article about data packets.
In short, the data we need to transmit over the network is divided into several parts. Then a special header (necessary for transmitting packets over the network) is added to this data and this data packet is transmitted over the network in the form of electrical or light signals.
So, about L1 level.
Network cards in computers and servers are responsible for converting data bits at the first level, while SFP modules in network devices such as switches, routers, etc. are used to transmit packets over the network.
❯ Basic functions of the physical layer
Bit transfer:
The physical layer defines how data bits are transmitted over a physical medium, whether copper cables, fiber optic cables, or wireless links.
Copper cables transmit information using electrical signals, there are 1G and 10G copper cables, like twisted pair. I was surprised that there is 10G copper.
Fiber optic cables transmit information using light signals.
Wireless ones transmit information wirelessly, using radio waves.
Modulation and demodulation: Converting digital data into analog signals and vice versa.
Modulation and demodulation are processes used to transmit digital data over analog media such as radio waves, telephone lines, or fiber optic cables. These processes play a key role in modern communications systems, including the Internet, mobile networks, and television.
❯ Modulation
Modulation is the process of converting digital data (bits) into analog signals that can be transmitted over an analog medium.
❯ Demodulation
Demodulation is the process of converting analog signals back into digital data. A demodulator takes the modulated analog signal and extracts the original digital data from it.
❯ Importance of Modulation and Demodulation
- Efficient data transfer: Modulation allows digital data to be transmitted over analog media such as telephone lines and radio waves, which have limited bandwidth and are prone to noise.
- Compatibility: Thanks to modulation, digital systems can be compatible with existing analogue infrastructure.
- Interference resistance: Different modulation methods can be more resistant to different types of interference and noise, which improves the quality of data transmission.
- Increased throughput: The use of complex modulation techniques such as QAM allows more data to be transmitted in one cycle, which increases the overall capacity of the communication channel.
Modulation and demodulation are key processes that enable digital data to be transmitted over analog media, providing efficient, reliable, and high-speed communications.
Electrical characteristics: definition of voltages, currents and frequencies used for data transmission.
Voltage defines the potential difference between two points in a network. Data networks, such as Ethernet, use different voltage levels to encode digital data. A low voltage can be interpreted as a “0” bit, and a high voltage can be interpreted as a “1” bit.
- Current — is the flow of charged particles through a conductor. In data networks such as Ethernet, current is used to carry information. Changes in current can be interpreted as changes in the bit values of data. The current consumed is also determined by the resistance of the conductors and devices through which the data passes.
- Frequency determines the speed at which data is transmitted over a network. In Ethernet and other data networks, frequency determines the speed at which data is transmitted, measured in bits per second (bps). For example, Ethernet may have a frequency of 100 MHz or 1 GHz, which determines the maximum speed at which data can be transmitted over the network.
Mechanical characteristics:
definition of physical connections, connectors and cables.
Physical Connection: — is the way devices on a network are physically connected to each other. A physical connection can include different types of cables, connectors, and ports. For example, in local area networks (LANs), devices are often connected using Ethernet cables.
Connectors: — are physical interfaces that allow cables to be connected to network devices. There are many types of connectors, each designed for specific types of cables and protocols. For example:
- RJ45: used to connect twisted pair Ethernet cable.
- LC/SC: are used in fiber optic networks.
The connectors provide a reliable and standardized connection that ensures compatibility between devices.
Cables: — are the physical media through which data is transmitted. The type of cable determines the speed at which data can be transmitted, the distance over which data can be transmitted, and the environment in which the cable can be used. The main types of cables include:
- Twisted Pair: The most common type of cable for local area networks. Includes unshielded twisted pair (UTP) and shielded twisted pair (STP).
- Fiber Optic Cable: used for high-speed connections over long distances. Transfers data using pulses of light.
- Each cable type has its own characteristics, such as bandwidth, resistance to interference, and maximum transmission distance.
❯ Examples of mechanical characteristics in an Ethernet network
- RJ45 connector: used to connect Ethernet cables to network devices such as routers, switches, and network cards.
- Fiber optic with LC/SC connectors: used for both high-speed trunk connections and long-distance connections, as well as short-distance connections (like RJ connectors).
❯ Why is it important
Mechanical characteristics are important to ensure reliable and efficient connections between devices in a network. They affect:
- Compatibility: Using standardized connectors and cables ensures that devices can be connected and will work together.
- Performance: The type and quality of cables and connectors can affect data transfer speed and connection stability.
- Interference resistance: Shielded cables and proper connectors can reduce the effects of electromagnetic interference and improve connection quality.
- Physical protection and durability: Reliable connectors and cables ensure durability and reliability of the physical connection, which is especially important in industrial and commercial networks.
- Physical topology: determining the location and connection of network devices.
- The physical topology of a network defines the physical arrangement and connection of network devices such as computers, routers, switches, and cables. It is an important aspect of network design and management because it affects the performance, scalability, reliability, and manageability of the network.
Let's look at the main types of physical topology and their characteristics.
❯ Basic types of physical topology
1. Bus Topology
In this topology, all devices are connected to one common cable (bus). Data is transmitted through this cable, and all devices can receive this data.
Advantages:
- Easy to install and low cost.
- Ease of adding new devices.
Flaws:
- Limited cable length and number of connected devices.
- A cable failure causes the entire network to fail.
- Low performance with a large number of devices.
2. Star Topology
All devices are connected to a central node (switch or hub). The central node manages the transfer of data between devices.
Advantages:
- High performance as data is transmitted through a central node.
- Easy to operate and troubleshoot.
- The failure of one device or cable does not affect the operation of the entire network.
Flaws:
- Dependency on the central node: if it fails, the entire network stops working.
- Higher cost due to the need for a central hub and more cables.
3. Ring Topology
The devices are connected in a ring, and each node is connected to two neighboring nodes. Data is transmitted along the ring from one device to another.
Advantages:
- Uniform distribution of load between nodes.
- No collisions during data transmission.
Flaws:
- A breakdown of one device or cable disrupts the operation of the entire network.
- Difficulty adding new devices.
4. Mesh Topology
In this topology, every device is connected to every other device. There is a full mesh topology, where all devices are directly connected to each other, and a partial mesh topology, where some devices are not directly connected.
Advantages:
- High reliability: failure of one device or cable does not affect the operation of the entire network.
- High performance and minimal latency.
Flaws:
- High cost and complexity of installation.
- Complexity of management and maintenance.
5. Tree Topology
A combination of star and bus topologies. Devices are connected into groups, which in turn are connected by central nodes.
Advantages:
- The hierarchical structure simplifies management.
- Ease of network scaling.
Flaws:
- Dependence on central nodes.
- More complex setup than simple star topology.
❯ Why is physical topology important?
- Performance: Different topologies offer different levels of performance and can handle different volumes of traffic.
- Reliability: Topology affects the resilience of the network to failures. Some topologies are more resilient to failures of individual devices or cables.
- Scalability: Different topologies handle adding new devices and expanding the network differently.
- Controllability: Some topologies are easier to manage and troubleshoot.
- Price: The cost of installing and maintaining a network depends on the topology chosen, as different topologies require different amounts of cables and equipment.
The physical topology of a network plays a key role in the design, management, and maintenance of network systems to ensure optimal performance and reliability.
Core technologies
- Cables and connectors: RJ45, fiber optic cables, coaxial cables.
- Electrical characteristics: RS-232, V.35, 100BASE-TX, 10BASE-T.
- Wireless standards: 802.11 (Wi-Fi), Bluetooth.
Basic standards
- RS-232: standard for serial data exchange. (this is not a connector as is commonly believed, DE-9 is a connector, and RS-232 is a standard)
- V.34: a standard for modems that defines modulation methods for transmitting data over telephone lines at speeds up to 33.6 kbps.
- 100BASE-TX: standard for transmitting data over twisted pair at a speed of 100 Mbit/s.
- 802.11: a set of standards for wireless networks.
Application of the physical layer in practice
In practice, the physical layer is used to create and maintain physical connections between network devices. For example, when you connect a computer to a router using an Ethernet cable, you are interacting with the physical layer. It is important to understand that any problems with cables or connectors at this layer can lead to data transmission failures.
❯ What happens to the data if you disconnect the cable?
Disconnecting a network cable and its impact on network model layers
When a network cable is pulled, it only affects the physical layer of the OSI network model, but how does it affect the operation of the TCP/IP protocols?
Physical Layer
The physical layer is responsible for transmitting data over a physical medium, such as copper cable or fiber optics. When a network cable is disconnected, devices at this layer lose the ability to transmit signals. This layer can recognize that a cable has been pulled because the electrical or optical signal is no longer transmitted.
Data Link Layer (more about this layer in the next article)
The data link layer interacts directly with the physical layer and manages access to the data transmission medium, error detection, and flow control. When a cable is disconnected, a network interface such as Ethernet signals an error such as “link down.” This event is recorded at this layer, but is not necessarily passed up.
TCP/IP and higher protocols
TCP/IP stack protocols (such as TCP, UDP, IP) operate at higher layers and do not have direct access to information about the physical state of the connection. They operate on virtual representations of the network provided by lower layers. Therefore, when a cable is disconnected, TCP/IP will not know about it directly unless information about the connection break is passed from lower layers.
Connection break detection mechanisms
In order for higher-level protocols such as TCP to know about a connection break, special mechanisms are used:
- KeepAlive: Once a connection is established and the KeepAlive option is enabled, TCP begins sending small control packets after a certain amount of inactivity. If a certain number of KeepAlive packets do not receive a response, TCP considers the connection invalid and initiates a connection break.
- Timeouts: TCP packets have built-in timeout mechanisms that allow it to determine that data has not been delivered within a certain amount of time. In the event of a timeout, TCP attempts to retransmit the data or terminate the connection.
When a network cable is disconnected, it is first detected at the physical and data link layers of the network. However, unless the disconnection information is passed upstream, the TCP/IP protocols do not know about it directly. To address this issue, TCP provides mechanisms such as KeepAlive and timeouts that help detect the loss of a connection and take appropriate action. These mechanisms ensure the reliability and resilience of network applications, even in the face of physical network failures.
❯ Conclusion
The physical layer of the OSI model is the foundation for all other layers. Without a reliable physical connection, the other layers cannot perform their functions. Understanding how the physical layer works will help you effectively troubleshoot and optimize the performance of network devices.
In the next article we will look at the data link layer (L2) and its role in networking.
Thanks for your attention, and see you in the next article!
Read also:
News, product reviews and contests from the Timeweb.Cloud team — in our Telegram channel ↩
News, product reviews and contests from the Timeweb.Cloud team — in our Telegram channel ↩