The
WireMe page, for
advanced comprehension of
the network mechanism.
Network interconnection is a very complicated issue that is usually well hidden to the normal user, who is in general preoccupied about a phone line, a modem and an internet connection account and his/her worries begin when the provider's dialup lines are busy or the transfer rates drop below 1k/sec. Let's get a little deeper than that, not because it is actually needed, but because ... hey, you wouldn't install a GNU/Linux or FreeBSD OS if you didn't want to learn something more, would you? Paragraphs in this page are: The Osi Model Common issues against the Osi Model Dynamic ip assignment Links The Osi Model OSI (Open Systems Interconnection) is an ISO - International Telecommunication Union Standard description or "reference model" for how messages should be transmitted between any two points in a telecommunication network. According to OSI, the digital network interconnection is a task that is divided among many simple standarized procedures that are called layers. These layers are modular: specialized in a single job, not "aware" of the other layers' jobs and cooperating in order to accomplish the general task of two remote computers communicating with each other. They will be presented from lower to higher. The Osi Model Layers: Layer 1: The Physical. The Network Interface card, the RS 232 Serial Port chip or the Parallel Port are some of the common hardware types used for interconnecting computers. They are responsible of sending on one end and receiving from another just raw bits over a channel. Here all concern is electrical: Volts, speed and duration of bits, synchronous or asynchronous transfers, start and end of a transfer etc. Layer 2: The Data Link. Once a connection is initialized, adressing each interface's position in the communication channel, grouping bits into frames (group of data) from the physical sender, or the opposite, breaking the frame into bits to the physical receiver, handling the busy or free status of the channel and preventing bottlenecks or overflows between the interfaces are some of the tasks that the Data Link Layer has to accomplish. Either addressing or transmitting, the Data Link Layer (2) handles only the physical interconnection and nothing beyond that. Layer 3: The Network. Networks are complicated. Networks are hybrid. Networks are grouped into subnets. In the Internet, which is in reality an intercommunication between networks, we experience a very interesting situation: The data transferred does not pass through a single cable. Actually we dial up, the connection passes through an swiched and routed ethernet network, then maybe satellite or cable transfers this data, routers and bridges are used to direct this data that almost always has many options considering the travel to the destination etc. etc. What does all this tells us: That the Data Link layer is not enough to address and name the entire network; This task has to be in a higher level. This is therefore the 3rd level: The Networking one, the one that names the subnets. Layer 4: The Transport. In simple words, the Transport Layer is the intermediate layer between the higher ones and the lower ones: Handles pieces of data (packets) and ensures that they have travelled without errors. Some Layer 4 protocols implement error control and some do not. This depends on the use of the data: For example, downloading a file makes it crucial that the package we receive is exactly the same with the one stored to download, therefore requires an error control, but in the other hand, broadcasting and gaming interconnection do not have to be so fanatic, because the data received is useful only momentarily. Layer 5: The Session. It has been widely accepted that the Osi standard is more theoretical than practical. The Session Layer is one of the layers that is in general implemented within others inside network protocols. But consider this nevertheless. Some of the tasks the Session Layer hahdles are: Initialization duration and ending of a session Bidirection or not depending on the session type Security and dialogue control Synchronization in certain protocols (attempt the same operation in the same time or not) Checkpoints into the data steam for the purpose of partial downloading for example. Do not feel too guilty though, if this layer appears not as "clear" as the others. Layer 6: The Presentation. While the lower layers 1-5 are mainly preoccupied with the reliability of the data travel, the 6th layer is mainly concerned about portability. Computers are different. Some may be ASCII based, others rely on EBCDIC. Some accept the "Date" format in a specific way and some in another. Byte ordering may be different too. The Presentation Layer is an abstract method for encoding data. It makes the data type transparent to the layers around it, therefore different data structures like integers, strings and dates have now a commonly agreed "portable" format. Layer 7: The Application. In general, when we are surfing the Net, we can visit a web page, send and receive mail, visit a newsgroup, chat and connect to an ftp site simultaneously. Our concern is more in bandwidth and less in the number of applications that use the network connections. But how can this be? If we agree that we do not do all these tasks through a web interface (which can be done at least for some of them), how does our web browser distinguish and therfore ignore the mail we are downloading, and why is this data concerning our mail application? This is one of the tasks of the Application Layer: Distinguish the data between applications. For this to be clearer, do not think only about clients. Better think about client-server communication (web browser to a web server, news reader to a news server etc.etc.) Abstraction is another task. Examples: While there are hundreds of terminals with separated and incompatible protocols (remember the BBS terminals?), all the virtual terminals have a common method of mapping keyword actions. Different OSes have different file naming methods (e.g Unix uses a slash "/" and not drive letters) or different ways of representing text (Unix strings end with ascii code "0", Windows strings do not), but cooperation must exist between applications within these different OSes. Common Issues against the Osi Model Modem Osi describes digital networks, so the modem, the job of which is to modulate/demodulate a digital data stream to/from an analog electrical wave, does not have a place to the Osi Model. For Osi, the modem is an opaque way to transfer data between two network interfaces, the one in our side, usually the RS-232 Communications Port chip and the other's side interface. So, when 2 modems communicate through a phone line, in reality it is the Serial ports that interconnect. PPP When we dial up and both sides modems initiate an electrical wave connection, our serial port connects to the other end (possibly another serial port) peer to peer. In other words, a one-by-one connection is established. Terminal applications can communicate this way and terminal programs like Telix, Telemate, Hyper Terminal and minicom can communicate with each other or enter a BBS. But this connection is not a network yet. Layer 1 (physical) has initialized, but Layer 2 (Data Link) has not. That's what Point To Point Protocol is: The Data Link Layer (2). But remember the modem case? The modem does not mean anything to OSI. In reality, the Serial ports are connected through the modems. PPP can establish Data Link with serial ports directly connected to each other. So, your old laptop can connect serial - to - serial with another host belonging to the network and be a part of it. SLIP was an ancestor of PPP and almost obsolete now. PLIP is Layer 2 for parallel ports. Dialup to the Internet This is also described in SecureMe - Linux experience for Windows users - Hide Ip adresses in messengers. When we dial up, in reality we make three steps: 1) The modems (our and our IPS's) interconnect. 2) A ppp protocol (Level 2 - Data Link) is brought up. 3) A client IP Adress (ours) and a server IP Adress (in the other side of the ppp link) are assighed (Level 3 - Network). This IP identifies our connected computer in the Internet. As these steps are sequential and Linux does not lack the specialized tools, the dial-up action can be set with scripts. - more details about these tools will be coming soon - Ethernet Ethernet is a Layer 1 & 2 network technology. It implements both Physical and Data Link layers. It was named after Ether, the late 1900 "mysterious" electromagnetic wave carrier and in simple words is telecommunication through electromagnetic wave that travels through a cable instead of air. Due to simplicity and price it has dominated small to medium networks, but due to it's principles, because all data is actually travelling through a single cable even if hubs are used, large networks tend to overload. Switched Ethernet is now very competitive against larger network technologies like Token Ring, because overloading and bottleneck issues are reduced. Unlike the Hub, which is a Layer 1 extender (it just forks cables), the Swich is Layer 1-2 extender. Once the communication between hosts has been established once, the Swich remembers the cables used for specific MAC adresses (think layer 2), therefore can decide the path in which data moves and leave other paths quiet. TCP/IP The Transport Control Protocol/Internet Protocol is the commonly used Layer 3-4 implementation for LANs, WANs, the Internet, Peer to Peer connections etc. It can easily construct from small up to huge networks. It does not rely heavily on broadcasting, thus keeps "quiet", which is an excellent behavior for big networks. It can be routed by default, making communication between heterogenous networks easy. Gateways and Routers connect Subnets and Network protocols like NetBios can be encapsulated within TCP/IP. In reality, IP (3rd Layer) has no other means for idenifying a host than the host's IP (address). To identify hosts with names we either: 1) manually maintain a reference file (etc/hosts) 2) bring up a Name Server that upon name query returns the Host's Ip Addresses. (Visit the /etc/hosts and /etc/resolv.conf in ConfigMe). TCP implements error control, therefore guarantees correct Data delivery between sender and receiver. Interesting enough is that TCP/IP does not implement only 3&4 OSI layers. Because TCP/IP has a built-in "port" addressing mechanism, it gets very easy to distinguish between different applications that would send/receive specific packets ignoring the other ones. If a packet goes to 192.168.0.1:80 (meaning port 80) it will be intercepted by the web client or server and not by the mail client or server. Therefore, TCP/IP additionally serves 5&7 layers "in a way". Unlike OSI (which is theoretical), TCP/IP handles the network as a 5-layer structure. Think of the last three (session-presentation-application) as if merged into one (the fifth). FTP - Telnet FTP (File Transfer Protocol) and Telnet (Telephony Network) are protocols that offer specific services: Ftp for file transfers, Telnet for terminal services over the network. These two protocols are higher than level 4. In reality, they are implementing Layer 5 (Session) and 7 (Application) inside the Osi Model. UDP In very simple words think UDP as an alternative to TCP, therefore a Layer 4 protocol. User Datagram Protocol acts as intermidiate between Layers 3 (Network) and 7 (Application). Remember this phrase from Layer 4: The Transport: " ... but in the other hand, broadcasting and gaming interconnection do not have to be so fanatic, because the data received is useful only momentarily." UDP Data delivery between sender and receiver is not guaranteed. Games, ipphones and in general all applications that have realtime needs often use UDP for network connections. --------- to be continued --- Topology MAC Adresses Hubs Bridges - Switches NetBios NFS - SMB Dynamic ip assignment When a network reaches a certain stage of plurality and diversity, a centralized and dynamic network configuration mechanism becomes a necessity. This is done (again) using a client - server mechanism called Dynamic Host Configuration Protocol or DHCP. Client network configuration is set to automatic, while the linux server runs a dhcp daemon like dhcpd. For dhcpd, the configuration file needed is /etc/dhcpd.conf Server's side: Edit the configuration file as root, restart the service or just do: killall dhcpd ; dhcpd Then configure the service to run or issue dhcpd in /etc/rc.d/rc.local Client's side: Windows users leave the network to automatic. Linux boxes are usually set to automatic. If not run dhcpcd eth0 (for the first ethernet) and if it works, just put it in the /etc/rc.d/rc.local. Links http://searchnetworking.techtarget.com/sDefinition/0,,sid7_gci212725,00.html http://www.webopedia.com/quick_ref/OSI_Layers.asp http://en.wikipedia.org/wiki/Open_Systems_Interconnection http://en.wikipedia.org/wiki/Ethernet http://en.wikipedia.org/wiki/Point-to-Point_Protocol |