Direct-attached networks

Source: Internet
Author: User
Tags bit set

Direct-attached Networks chapter II

There are five issues that must be resolved before a node can successfully swap packets.
1. Bit encoding on media such as Copper wire ( encoding )
2. Describe the sequence of bits transmitted on the link as a complete message for delivery to the end node, which is called a group frame ( framing )
3. There are sometimes errors in the frame during transmission, so it is necessary to detect such errors and take appropriate action, which is called Error detection ( error detection ).
4. Create a seemingly reliable link in the frame, despite the time and again error
5. In the case of multiple hosts sharing a link (rather than using a simple dot-to-point link), access to the link must be reconciled, which is the media access control ( media access control )

2.1 Network components

The network consists of two types of hardware artifacts: nodes node and Linkslink

2.1.1 node

A node refers to a universal computer. To facilitate the introduction, assume that the node is a workstation class machine.

The most scarce resource in the network: bandwidth and memory.

Memory is a scarce resource because when a node acts as a switch or router, the packet must be cached in memory before it waits to be transmitted to an output link. At the same time, the memory delay improves much less than the CPU, as a network node, the workstation is running at its memory speed, not CPU speed.

Network adapter

The adapter outputs a control status register ( control state register ), which is read/write to the CPU. The software (device driver) on the host writes information to the CSR, instructs it to transmit/receive a frame, and reads the information from the CSR to obtain the current state of the adapter. In order to notify the host of an asynchronous event such as receiving a frame, the adapter interrupts the host.

One of the most important problems with network adapters is how data bytes are passed between the adapter and the host memory. Direct Memory Access ( Direct Memory Access,DMA ) and programmable input output (programmed I/o,pio). DMA: The adapter directly reads and writes the host memory without CPU intervention, and the host simply gives the adapter a memory address that the adapter can read and write to. PIO:CPU is directly responsible for passing data between the host memory and the adapter.

2.1.2 Links Link

Network links can be implemented in a variety of different physical media. It is usually possible to transmit two bit streams at the same time in each direction on a dot-to-point link. Such a link is called full duplex (Full-duplex). One-point link that only supports data flow in one direction at a time, called Half-duplex (Half-duplex), requires two nodes connected to the ride to take turns using the link.

2.2 Encoding Nrz,nrzi,manchester,4b/5bnrz Non-return to zero

The data value 1 is mapped to high, and the value 0 is mapped to a low level.
A long list of 0 and 1 leads to two basic problems
The first problem is baseline wander the state that caused the baseline drift (). The receiver maintains an average of the signals it sees, and then uses this average to differentiate between high and low levels.
The second problem is the high end and the frequent conversion from low to high, which must be done using the clock recovery ( clock recovery ). Clock recovery problem is: the encoding and decoding process is driven by a clock, each clock cycle sender sends 1bit, the receiver recovers 1bit. In order for the receiver to recover the bits sent by the sender, the sender and receiver clocks must be accurately synchronized. As long as there is a jump from 1 to 0 goods from 0 to 1, the receiver knows that it is on the boundary of the clock cycle, he can resynchronize himself, however, if the long period without such a jump will cause the clock offset.

NRZI Non-return to zero inverted inversion

The sender encodes a 1 of the current signal with a jump to keep the current signal encoded by a 0. This solves the problem of 1 in a row, but obviously does not solve the problem of 0 consecutive.

Manchester Manchester Code

By transmitting the NRZ encoded data and the clock's XOR value, the clock and signal are obviously merged (the local clock is considered to be an internal signal from low to high, and a pair of low/high varying levels is considered a clock cycle). Note that the Manchester code will be 0 as a jump from low to high, 1 as a jump from high to low.
But the problem with Manchester's coding scheme is that it doubles the rate at which the signal jumps on the link, which means that the receiver has half the time to detect every pulse in the signal. The rate at which the signal changes is called the link baud rate (baud). In Manchester, the bitrate is half the baud rate, so the encoding is considered to be only 50% efficient.

4b/5b

This is a solution to the inefficiency of Manchester coding by not expanding the duration of a high signal or low signal. 4B/5B's idea is to insert extra bits into the bitstream to break a series of 0 or 1. To be exact, a 5 bit is used to encode 4 bits of data, which is then transmitted to the receiver. The 5-bit code is selected in the following ways: Each code has a maximum of 1 leading 0, and the end has a maximum of two 0. Since the 5-bit code is sufficient to encode 32 different codes, the remaining 16 can be used for different purposes.

2.3 Framing 2.3.1 Byte-oriented protocol

The first framing method is to treat each frame as a set of bytes (characters) instead of a bit set. such as PPP and Bisync.

Two ways to detect the end of a file
    1. Starting and ending marking method
    2. Byte counting method

When you want to have the same data as the starting and ending characters in the data section of the frame, you need to insert additional characters into the data portion of the frame, so this method is known as the character fill method.

2.3.2 Bit-oriented protocol (HDLC)

Unlike byte-oriented protocols, a bit-oriented protocol does not care about the bounds of a byte, it only sees the frame as a set of bits.
Similarly, if the data section appears the start and end control bit sequence, you need to use the bit Fill method.

2.3.3 Clock-based framing (SONET)

Slightly

2.4 Error detection

Sometimes a bit error occurs in the frame. For example, such an error can occur due to electrical disturbances or thermal noise.
The error is only part of the problem, and the other part is an immediate error correction when a mistake is found. When the receiver of a message detects a mistake, two basic methods can be taken. One is to notify the sender that a message is corrupted so that the sender can resend a copy of the message. If there is little bit error, then the retransmission copy is likely to be error-free. Another approach is to use a centralized error detection algorithm that allows the receiver to reconstruct the correct message even after the message has been faulted. These algorithms depend on the error correction code () discussed below error-correcting codes .

The basic idea of any error detection scheme is to add redundant information to the frame to determine if there are any errors.

2.4.12 D Parity check

It is based on a "simple" (one-dimensional) parity check-typically attaching an additional 1 bits to the 7-bit encoding to balance the number of 1 bytes. For example, the odd check resets the 8th bit to the number of bytes in 1, making the number of 1 in 8 bits odd, while the parity bit 8th bit makes the number of 1 in 8 bits even. Two-dimensional parity computes a similar calculation for each bit position of each byte in the frame. As a result, an extra parity byte is generated for the entire frame, except that each byte adds a parity bit. It can be proved that the two-dimensional parity check detects all 1, 2, 3-bit errors and most 4-bit errors. In this case, we have added 14 bits of redundant information to the 42-bit message.
Simple two-dimensional parity check code, but also to understand!

2.4.2 Algorithm of Internet checksum

The idea of an Internet checksum is very simple-add all the words that are transferred, and then transfer the result of the addition, which is called a checksum. The receiver performs the same calculation on the received data and compares the resulting results with the checksum received. If any of the transmitted data (including the checksum itself) goes wrong, the result will be different and the receiver will know that an error has occurred.

This algorithm is better than repeated coding because it uses very few redundant bits, that is, 16 bits for any length of message, but its error detection ability is not very good. For example, there is a pair of single-bit errors, one bit error increases one word by 1, while another bit error reduces the other word by 1, and cannot be detected if the number of errors is the same. Although it is relatively weak in terms of error detection (for example, compared to CRC), we still use this algorithm for simple reasons: the algorithm is easy to implement with software. The experience of the ARPANET network shows that this form of checksum is sufficient. The reason is that the checksum is the last line of defense for an end-to-end protocol, and most of the errors are checked out by a stronger error detection algorithm (such as CRC) on the link layer.
Inter-network check and algorithm

2.4.3 Cyclic redundancy check

Slightly

2.5 Reliable Transmission

Even when using error-correcting codes, such as on a wireless link, some errors can be too severe to correct. Therefore, some error frames must be discarded. A link layer protocol that wants to reliably transmit frames must be able to recover these discarded (lost) frames in some way.
This is usually done using a combination of two basic mechanisms-acknowledgment ( acknowledgement ) and timeout ( timeout ). Acknowledgment (ACK) is a small control frame that the protocol sends to its peer entity, informing it that it has received the frame just now. The so-called control frame is a header without any data, but the protocol can also send an ACK (piggyback) to a data frame that happens to be sent to each other. The sender of the original frame receives confirmation that the frame was sent successfully. If the sender does not receive confirmation after a considerable amount of time, then it re-transmits (retransmit) the original frame. An action that waits for a considerable amount of time is called a timeout.
Policies that use acknowledgments and timeouts for reliable transmission are sometimes referred to as automatic request retransmission ( Automatic Repeat Request , ARQ).

2.5.1 stopping and waiting for stop and wait

After the sender transmits a frame, wait for a confirmation before transmitting the next frame. If you confirm that you did not arrive after a certain period of time, send Fang Chao and retransmit the original frame.
There is an important detail in the stop and wait algorithm if the sender sends a frame, and the receiver confirms it, but the acknowledgment is lost or late. In both cases, the sender times out and re-transmits the original frame, but the receiver thinks it is the next frame, because he correctly receives and confirms the frame. This causes the problem of duplicate transfer frames, in order to solve this problem, you can include a bit ordinal number in the header, that is, the sequence number can take 0 and 1, and each frame alternately use the ordinal.
Disadvantage: Only the sender is allowed to have only one indeterminate frame on the link at a time, which may be far below the capacity of the link.

2.5.2 Sliding windows sliding window

Three tasks:
1. Reliable transmission of frames on unreliable links
2. Maintain the transmission sequence of frames
3. Flow controlflow control

Sending party

The working process of the sliding window algorithm is as follows. First, the sender assigns a sequence number () to each frame sequence number as a notation SeqNum . Now, ignoring the SeqNum fact that it is implemented by a finite-sized header field is assumed to be infinitely larger. The sender maintains three variables: Send window Size ( send window size ), denoted as SWS, to the upper bound of the number of frames that the sending party can send but not confirm; Lar represents the ordinal of the most recently received confirmation frame (), and last acknowledgement received LFS represents the ordinal of the most recently sent frame ( last frame sent ). The sender also follows the following inequalities:

LFS-LAR≤SWS

Receiving party

When the confirmation arrives, the send direction right moves lar, allowing the sender to send another frame. At the same time, the sender sets a timer for each frame that is sent, and if the timer times out before receiving an ACK, retransmit the frame. Note that the sender must be able to cache up to SWS frames, because retransmission must be prepared before they are confirmed.

The receiver maintains the following three variables: The Receive window size ( receive window size ), denoted as RWS, giving the upper bound of the number of unordered frames the receiver can receive; Laf represents the ordinal of the largest acceptable frame (), and largest acceptable frame Lfr represents the ordinal of the last received frame ( last frame received ). The receiver also follows the following inequalities:

LAF-LFR≤RWS

2.5.3 Concurrent logical channel concurrent logical channels

Multiplexing multiple logical channels on a point-to-page link and running the stop and wait algorithms on each logical channel. There is no relationship between frames transmitted on any logical channel, and since there can be a different frame to be confirmed on each logical channel, the sender can keep the link full.
More accurately, the sender leaves 3 bits for each channel state: A Boolean that indicates whether the channel is currently busy, a bit sequence number that describes the sequence number of the next frame to be sent on this logical channel, and the ordinal of the next frame, indicating the ordinal of a frame that is expected to reach this channel.
When a node has a frame to send, it uses the idle channel with the smallest ordinal number, and the rest behaves as if it were stopped and waited.

2.6 Ethernet

Ethernet is an example of a used, more general-purpose, carrier-monitored multi-access LAN technology with collision detection. (CSMA/CD)

2.6.1 Physical Properties

Ethernet is implemented on a coaxial cable with a length of up to 500m.
Multiple Ethernet can be connected by a repeater (repeater), a repeater is a device that forwards digital signals, much like an amplifier that forwards analog signals. However, a maximum of 4 repeaters can be installed between any pair of hosts, which means that the total Ethernet can only reach 2500m. Ethernet supports up to 1024 hosts.
Any signal sent by a host to the Ethernet is broadcast to the whole network, that is, the signal travels in two directions, and the repeater forwards the signal to all the output segments. The Terminator connected to the end of each segment absorbs the signal and prevents it from reflecting and interferes with subsequent signals.
Ethernet uses the Manchester code mentioned earlier.

2.6.2 Access Protocol

Control the algorithm for accessing shared Ethernet links-media access control for Ethernet (media access Control,mac). It is typically implemented on a network adapter in a hardware way.

Frame format
64bit 48bit 48bit 16bit 46-1500byte 32bit
Pre-sync Code Destination Address Source Address Type Frame body Crc
Address

Each host on the Ethernet has a unique Ethernet address. Technically, the address belongs to the adapter instead of the host, usually fixed in ROM, in a readable manner, that is, 6 numbers separated by a colon, each corresponding to a byte of a 6-byte address, and given by a pair of 16 decimal digits.

Transmitter algorithm

Send the line as soon as it is idle ( 1-persistant )
When a two adapter starts transmitting at the same time, two or more frames collide on the web ( collide ). Because Ethernet supports conflict detection, each sender can determine the occurrence of a conflict. When the adapter detects that its frame conflicts with other frames, it first ensures that the 32-bit interference sequence is transmitted and then stops the transmission. Therefore, the transmitter will send a minimum of 96 bits in case of conflict: 64-bit pre-sync code plus 32-bit interference sequence.

Once the adapter detects a conflict and stops the transfer, it waits a certain amount of time before attempting. After each attempt to send but failed, the adapter doubles the wait time and then tries again. The strategy of doubling the delay interval between retransmission attempts is generally known as exponential backoff (exponential backoff) technology.

2.7 Ring Net 802.5,FDDI,RPR

Ring Network and Ethernet have two common important characteristics: first, it includes a distributed algorithm to control when each node can be transmitted; second, all the nodes can generally see all the frames, and when the frame flows, the node that is identified as the destination in the frame header retains a copy of the frame.

The most common form of ring network early is the token ( token ) ring. When a node that has frames to transmit sees the token, it takes the token off the ring and inserts the direct frame into the ring. Each node along the road simply forwards the frame, the destination node saves a copy of the frame, then forwards the message to the next node of the ring, and when the frame returns to the sender, the node takes the frame off and then inserts the token.
In this way, a downstream node will have the opportunity to send a frame, and the media access algorithm is fair because the token loops around the loop, each node has the opportunity to send frames, and the token ring serves the nodes in a round-robin fashion.

With the ring topology, any link or node failure can cause the entire network to fail. The problem is solved by connecting each site to the ring by using an electromechanical repeater. Multi-station access unit (MSAU)

2.7.1 Token Ring Media access control

The token contains a 3-bit priority field, so we can assume that the token has a priority n at any given time. Each device that you want to send a group to has a priority for that group. The frame header uses 3 reserved bits to change the priority of a token.

The sender can put the card on the loopback immediately after sending the frame (this is known as early release early release ), or the sent frame around the ring once a week after the Ice Cup is deleted and then return the token (this is called delayed release delayed release ).

2.7.2 Token Ring Maintenance

Each token ring has a designated site as the monitoring station ( monitor ). The function of the monitoring station is to ensure that the ring is in good condition. Any station on the ring can become a monitoring station, and when the ring is first established or the current monitoring station fails, the monitoring station will be selected by the defined process. A state-of-the-good monitoring station periodically advertises its presence with a special control message if a site does not see the message for a period of time, assuming that the monitoring station has failed and is trying to become a monitoring station. (It is determined by a well-defined rule similar to "highest address wins").

2.7.3 FDDI

Consists of a double ring: two independent rings transmit data in the opposite direction. The second ring is not used normally and is enabled only if the primary ring fails.

2.7.4 Resilient Packet Ring RPR

Resiliency (the ability to respond quickly from a link or node failure) is a key design goal that makes this technology particularly suitable for service provider networks.
Instead of using tokens, a technique called buffer insertion (buffer insertion) is used.

Direct-attached networks

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.