Networking All-in-One For Dummies. Doug Lowe
Читать онлайн книгу.a random period of time and then tries to send the packet again. Because the delay is random, two packets that collide are sent again after different delay periods, so a second collision is unlikely.
CSMA/CD works pretty well for smaller networks. After a network hits about 30 computers, however, packets start to collide like crazy, and the network slows to a crawl. When that happens, the network should be divided into two or more separate sections that are sometimes called collision domains.
Logical addressing
As I mention earlier, every network device has a physical address — a MAC address — assigned to the device at the factory. When you buy a network interface card to install into a computer, the MAC address of that card is fixed and can’t be changed. So what happens if you want to use some other addressing scheme to refer to the computers and other devices on your network? This is where the concept of logical addressing comes in; with a logical address, you can access a network device by using an address that you assign.
Logical addresses are created and used by network layer protocols such as IP. The network layer protocol translates logical addresses to MAC addresses. For example, if you use IP as the network layer protocol, devices on the network are assigned IP addresses, such as 207.120.67.30. Because the IP protocol must use a data link layer protocol to send packets to devices, IP must know how to translate the IP address of a device to the device’s MAC address.
You can use theipconfig
command (refer to Figure 1-2) to see the IP address of your computer. The IP address shown in that figure is 192.168.1.111. Another way to display this information is to use the System Information command, best found by pressing the Windows key and searching for “System Information.” The IP address is highlighted in Figure 1-3. Notice that the System Information program displays a lot of other useful information about the network besides the IP address. For example, you can also see the MAC address and what protocols are being used.
FIGURE 1-3: Find network information from System Information.
Although the exact format of logical addresses varies depending on the protocol being used, most protocols divide the logical address into two parts:
Network address: Identifies which network the device resides on
Device address: Identifies the device on that network
In a typical IP address — say, 192.168.1.102 — the network address is 192.168.1, and the device address (called a host address in IP) is 102.
Routing
Routing comes into play when a computer on one network needs to send a packet to a computer on another network. In this case, a router is used to forward the packet to the destination network. In some cases, a packet may have to travel through several intermediate networks in order to reach its final destination network. You can find out more about routers in Chapter 4 of this minibook.
An important feature of routers is that you can use them to connect networks that use different layer 2 protocols. For example, a router can be used to send a packet from an Ethernet to a token ring network. As long as both networks support the same layer 3 protocol, it doesn’t matter whether their layer 1 and layer 2 protocols are different.
A protocol is considered routable if it uses addresses that include a network part and a host part. Any protocol that uses physical addresses isn’t routable because physical addresses don’t indicate to which network a device belongs.
The transport layer
The transport layer is where you find two of the most well-known networking protocols: TCP (typically paired with IP) and SPX (typically paired with IPX). As its name implies, the transport layer is concerned with the transportation of information from one computer to another.
The main purpose of the transport layer is to ensure that packets are transported reliably and without errors. The transport layer does this task by establishing connections between network devices, acknowledging the receipt of packets, and resending packets that aren’t received or are corrupted when they arrive.
In many cases, the transport layer protocol divides large messages into smaller packets that can be sent over the network efficiently. The transport layer protocol reassembles the message on the receiving end, making sure that all the packets that make up a single transmission are received so that no data is lost.
For some applications, speed and efficiency are more important than reliability. In such cases, a connectionless protocol can be used. As you can likely guess, a connectionless protocol doesn’t go to the trouble of establishing a connection before sending a packet: It simply sends the packet. TCP is a connection-oriented transport layer protocol. The connectionless protocol that works alongside TCP is User Datagram Protocol (UDP).
You can view information about the status of TCP and UDP connections by running the Netstat
command from a command window, as shown in Figure 1-4. In the figure, you can see that several TCP connections are established.
FIGURE 1-4: See TCP and UDP connections.
In fact, you can use the command Netstat /N
to see the numeric network addresses instead of the names. With the /N
switch, the output in Figure 1-4 would look like this:
Active Connections Proto Local Address Foreign Address StateTCP 127.0.0.1:2869 127.0.0.1:54170 ESTABLISHEDTCP 127.0.0.1:5357 127.0.0.1:54172 TIME_WAITTCP 127.0.0.1:27015 127.0.0.1:49301 ESTABLISHEDTCP 127.0.0.1:49301 127.0.0.1:27015 ESTABLISHEDTCP 127.0.0.1:54170 127.0.0.1:2869 ESTABLISHEDTCP 192.168.1.100:49300 192.168.1.101:445 ESTABLISHED
TCP is a connection-oriented transport layer protocol. UDP is a connectionless transport layer protocol.
The session layer
The session layer establishes conversations — sessions — between networked devices. A session is an exchange of connection-oriented transmissions between two network devices. Each transmission is handled by the transport layer protocol. The session itself is managed by the session layer protocol.
A single session can include many exchanges of data between the two computers involved in the session. After a session between two computers has been established, it's maintained until the computers agree to terminate the session.
The session layer allows three types of transmission modes:
Simplex: Data flows in only one direction.
Half-duplex: Data flows in both directions, but only in one direction at a time.
Full-duplex: Data flows in both directions at the same time.
In actual practice, the distinctions in the session, presentation, and application layers are often blurred, and some commonly used