[FreeBSD] Network Layer Protocols, TCP/UDP and Bootstrapping

2024. 7. 6. 20:31ComputerScience/FreeBSD

 

 

 

2.13 Network-Layer Protocols

  • Most of the communication domains supported by the socket IPC mechanism provide access to network protocols. These protocols are implemented as a separate software layer logically below the socket software in the kernel. The kernel provides many ancillary services, such as buffer management, message routing, standardized interfaces to the protocols, and interfaces to the network interface drivers for the use of the various network protocols.
  • Network layer protocols are layered just above or close to the network-interface software that manages the networking hardware. The Internet protocols IPv4 and IPv6 are two examples of a network layer protocol. FreeBSD has supported multiple protocols since 4.2BSD, providing interoperability and resource sharing among the diverse set of machines that exist in the Internet. Multiple-protocol support also provides for future changes.
  • Today’s protocols designed for 1- and 10-Gbit Ethernets are likely to be inadequate for tomorrow’s 40- to 100-Gbit networks. Consequently, the network-communication layer is designed to support multiple protocols. New protocols are added to the kernel without the support for older protocols being affected. Older applications can continue to operate using the old protocol over the same physical network as is used by newer applications running with a newer network protocol. (하나의 서비스가 환경에 따라 다양한 HTTP 버전으로 제공되는 것도 이에 해당하는 건가?) 
  • The original Internet protocols were not designed with security in mind. Protocols for securing the Internet have been added at multiple layers of the network stack, including the network layer itself. The IPSec suite of protocols introduces a framework for authenticating packet data and making them private at the network layer of the system.
  • Network firewalls such as PF and IPFW that need to modify network data as they pass through a system are also implemented at the network layer of the kernel software. The FreeBSD kernel has several packet-processing frameworks that manipulate network data as they pass through the system and that are outside the normal processing of incoming or outgoing network traffic. Other packet-processing frameworks exist for protocol experimentation and to give applications high-speed access to raw network packets without any network or transport layer protocol processing.

 

 

 

https://www.geeksforgeeks.org/network-layer-protocols/ https://www.router-switch.com/faq/network-layer-protocols-and-examples.html

 

 

 

2.14 Transport-Layer Protocols

  • Transport layer protocols (4계층) are responsible for end-to-end connectivity in a network. The Transmission Control Protocol (TCP) remains by far the most commonly used end-to-end transport protocol. However, key Internet services, such as the Domain Name System, allow users to look up systems by name using the User Datagram Protocol (UDP).
  • The popularity of TCP has lead to a continuous set of improvements to the protocol that enhances stability and improves performance. FreeBSD includes a framework specific to TCP that allows the tuning of certain performance and stability features. Newer transport protocols such as SCTP have added features for security and failover across communication paths. The UDP, TCP, and SCTP implementations are described in detail in Chapter 14. (HTTP3부터는 UDP base by Google) 

 

 

 

2.15 System Startup and Shutdown

  • Bootstrapping (or “booting”) the operating system is a complex multistep process that begins with the hardware platform’s BIOS or firmware loading an escalating series of operating-system vendor boot loaders, which in turn load a kernel and modules.
  • Once loaded, the kernel begins execution and after initialization it starts the first user process, init. The init process is responsible for starting the userspace boot process. The startup details vary by hardware platform: higher-end servers and workstations will, on the path to kernel load, run a series of smaller boot loaders that ultimately start /boot/loader, a scriptable loader environment supporting interactive selection of kernels, and network booting via NFS. (네트워크 파일 시스템?) By contrast, lower-end embedded systems often have a kernel that will be loaded directly by firmware without any intervening stages. (high vs low) 
  • The kernel starts by initializing a variety of internal subsystems such as the kernel memory allocator and scheduler. It uses platform-specific hardware enumeration methods to identify available hardware resources and attach drivers. Different techniques reflect different operational models: some hardware buses are self-enumerating (e.g., PCI), whereas other require manual description (e.g., many system-on-chip buses).
  • On desktop/server systems, one kernel will frequently be used on a variety of machine types from many different vendors. By contrast, embedded installations usually have a kernel configured for each target device. On the PC, this enumeration is normally done via ACPI, which allows the BIOS to describe the processor configuration, bus topology, and directly attached hardware devices. On embedded systems, device enumeration is done via systems such as Flattened Device Trees (FDT) that provide a static description of directly attached resources. Unlike ACPI, whose hardware descriptors are almost always shipped with the hardware itself, FDT(임베디드) hardware descriptions are usually embedded in the kernel. Buses such as PCI can do further dynamic enumeration by discovering attached devices such as Ethernet NICs, and bridges to further buses to enumerate.
  • The in-kernel boot process is controlled by a system known as SYSINIT, which takes advantage of a compiler/linker feature called linker sets. Linker sets allow symbols for data structures and functions to be tagged for inclusion in a particular part of the kernel. Subsystem initializers are tagged for inclusion in the kernel initialization section along with information on the order in which they should be done. When the kernel and its modules are linked, the kernel linker iterates through various tagged functions, sorting and then invoking them to start those kernel subsystems. A similar SYSUNINIT mechanism exists to perform ordered shutdown of modules before unloading them and in preparation for kernel shutdown or reboot. 
  • The kernel starts by initializing its own data structures, such as its virtual-memory structures that describe physical memory. Next, it starts a set of kernel threads that implement services such as timers. Devices are enumerated, and device drivers attached.
  • The network stack may perform not only per-protocol initialization, but also per-device initialization such as address generation and router discovery. The GEOM subsystem will identify storage devices and configure transforms such as RAID or encryption via GELI. Encryption services may require the user to have entered a passphrase in the boot loader. Eventually, a storage device suitable to use as the root filesystem will be discovered and its filesystem then mounted. Additional processors are enumerated and their schedulers likewise started. The final kernel-bootstrap step is to create the first user process with PID 1, to execute the /sbin/init binary. The init process is responsible for executing the startup scripts that perform filesystem checks, configure network interfaces, start accounting and quotas, start system daemons such as inetd and sshd, and bring the system up to full multiuser operation.
  • In multiuser operation, the system may act as a general timesharing system, supporting direct or network-based logins by users who then start processes running on their behalf. FreeBSD often acts as a server, providing file services and serving Web requests to network clients. All these network-based services can be started automatically at boot time. When used as a server, there is typically just one human user logged into the system (the administrator).

 

 

 

 

 

'ComputerScience > FreeBSD' 카테고리의 다른 글

[FreeBSD] Run-time structure of the kernel  (0) 2024.07.10
[FreeBSD] Kernel Organization  (0) 2024.07.09
[FreeBSD] Interprocess Communication  (0) 2024.06.29
[FreeBSD] ZFS and NFS  (0) 2024.06.29
[FreeBSD] The Fast Filesystem  (0) 2024.06.29