he Physical Layer is the first and lowest layer in the seven-layer OSI model of computer networking. The implementation of this layer is often termed PHY.
物理层一般简称为phy. 是OSI模型的最底层.
The Physical Layer consists of the basic hardware transmission technologies of a network. It is a fundamental layer underlying the logical data structures of the higher level functions in a network. Due to the plethora of available hardware technologies with widely varying characteristics, this is perhaps the most complex layer in the OSI architecture.
PHY是硬件实现, 可能是最复杂的一层.
The Physical Layer defines the means of transmitting raw bits rather than logical data packets over a physical link connecting network nodes. The bit stream may be grouped into code words or symbols and converted to a physical signal that is transmitted over a hardware transmission medium. The Physical Layer provides an electrical, mechanical, and procedural interface to the transmission medium. The shapes and properties of the electrical connectors, the frequencies to broadcast on, the modulation scheme to use and similar low-level parameters, are specified here.
硬件细节全在phy啦.(包括link检查)
Within the semantics of the OSI network architecture, the Physical Layer translates logical communications requests from the Data Link Layer into hardware-specific operations to affect transmission or reception of electronic signals.
The Ethernet physical layer is the physical layer component of the Ethernet standard.
The Ethernet physical layer evolved over a considerable time span and encompasses quite a few physical media interfaces and several magnitudes of speed. The speed ranges from 1 Mbit/s to 100 Gbit/s in speed while the physical medium can range from bulky coaxial cable to twisted pair to optical fiber. In general, network protocol stack software will work similarly on all of the following types. 10 gigabit Ethernet is becoming more popular in both enterprise and carrier networks, with 40 Gbit/s[1][2] and 100 Gbit/s Ethernet[3] now ratified[4]. Higher speeds are under development.[5]Metcalfe now believes commercial applications using terabit Ethernet may occur by 2015 though he says existing Ethernet standards may have to be overthrown to reach terabit Ethernet.[6]
The following sections provide a brief summary of all the official Ethernet media types (section numbers from the IEEE 802.3-2008 standard are parenthesized). In addition to these official standards, many vendors have implemented proprietary media types for various reasons—often to support longer distances over fiber optic cabling.
Many Ethernet adapters and switch ports support multiple speeds, using autonegotiation to set the speed and duplex for the best values supported by both connected devices. If auto-negotiation fails, a multiple speed device will sense the speed used by its partner, but will assume half-duplex. A 10/100 Ethernet port supports 10BASE-T and 100BASE-TX. A 10/100/1000 Ethernet port supports 10BASE-T, 100BASE-TX, and 1000BASE-T.
Fast Ethernet (100BASE-T) offers a speed increase ten times that of the 10BaseT Ethernet specification, while preserving such qualities as frame format, MAC mechanisms, and MTU. Such similarities allow the use of existing 10BaseT applications and network management tools on Fast Ethernet networks. Officially, the 100BASE-T standard is IEEE 802.3u.
802.3u, 1995年制定, 基本上实时标准.
Like Ethernet, 100BASE-T is based on the CSMA/CD LAN access method. There are several different cabling schemes that can be used with 100BASE-T, including:
* 100BASE-TX: two pairs of high-quality twisted-pair wires (就是4线制, 用的最多的.)
* 100BASE-T4: four pairs of normal-quality twisted-pair wires
* 100BASE-FX: fiber optic cables
The Fast Ethernet specifications include mechanisms for Auto-Negotiation of the media speed. This makes it possible for vendors to provide dual-speed Ethernet interfaces that can be installed and run at either 10-Mbps or 100-Mbps automatically.
The IEEE identifiers include three pieces of information. The first item, "100", stands for the media speed of 100-Mbps. The "BASE" stands for "baseband," which is a type of signaling. Baseband signaling simply means that Ethernet signals are the only signals carried over the media system.
The third part of the identifier provides an indication of the segment type. The "T4" segment type is a twisted-pair segment that uses four pairs of telephone-grade twisted-pair wire. The "TX" segment type is a twisted-pair segment that uses two pairs of wires and is based on the data grade twisted-pair physical medium standard developed by ANSI. The "FX" segment type is a fiber optic link segment based on the fiber optic physical medium standard developed by ANSI and that uses two strands of fiber cable. The TX and FX medium standards are collectively known as 100BASE-X.
The 100BASE-TX and 100BASE-FX media standards used in Fast Ethernet are both adopted from physical media standards first developed by ANSI, the American National Standards Institute. The ANSI physical media standards were originally developed for the Fiber Distributed Data Interface (FDDI) LAN standard (ANSI standard X3T9.5), and are widely used in FDDI LANs.
1.4.158 link pulse: Communication mechanism used in 10BASE-T and 100BASE-T networks to indicate
link status and (in Auto-Negotiation-equipped devices) to communicate information about abilities and
negotiate communication methods. 10BASE-T uses Normal Link Pulses (NLPs), which indicate link status
only. 10BASE-T and 100BASE-T nodes equipped with Auto-Negotiation exchange information using a Fast
Link Pulse (FLP) mechanism that is compatible with NLP. (See IEEE 802.3 Clauses 14 and 28.)
1.4.185 Normal Link Pulse (NLP): An out-of-band communications mechanism used in 10BASE-T to
indicate link status. (See IEEE 802.3 Figure 14–12.)
At power-on, in place of entering the Link Test Pass state as shown in Figure 18–4,
32 a MAU may optionally
enter the Link Test Fail Low Light state.
If a visible indicator is provided on the MAU to indicate the link status, it is recommended that the color be
green and that the indicator be labeled appropriately. It is further recommended that the indicator be on when
the MAU is in the Link Test Pass state and off otherwise.
22.2.4.2.13 Link Status
When read as a logic one, bit 1.2 indicates that the PHY has determined that a valid link has been estab-
lished. When read as a logic zero, bit 1.2 indicates that the link is not valid. The criteria for determining link
validity is PHY specific. The Link Status bit shall be implemented with a latching function, such that the
occurrence of a link failure condition will cause the Link Status bit to become cleared and remain cleared
until it is read via the management interface. This status indication is intended to support the management
attribute defined in 30.5.1.1.4, aMediaAvailable.
If a visible indicator is provided on the PHY to indicate the link status, it is recommended that the color be
green and that the indicator be labeled appropriately. It is further recommended that the indicator be on when
the PHY is in the LINK_PASS state and off otherwise.
Autonegotiation is an Ethernet procedure by which two connected devices choose common transmission parameters, such as speed and duplex mode. In this process, the connected devices first share their capabilities as for these parameters and then choose the fastest transmission mode they both support.
In the OSI model, autonegotiation resides in the physical layer. It was originally defined in the IEEE standard 802.3u in 1995. It was placed in the fast Ethernet part of the standard but is also backwards compatible to 10BASE-T. However, its implementation was optional, and a part of the specification was open to interpretation. The debatable portions of the autonegotiation specifications were eliminated by the 1998 version of IEEE 802.3. In 1999, the negotiation protocol was significantly extended by IEEE 802.3ab, which specified the protocol for gigabit Ethernet, making autonegotiation mandatory for 1000BASE-T gigabit Ethernet over copper. Specifically Section 28D.5 Extensions required for Clause40 (1000BASE-T)[1]
(跳过)
OverviewAutonegotiation can be used by devices that are capable of different transmission rates (such as 10 Mbit/s and 100 Mbit/s), different duplex modes (half duplex and full duplex), and/or different standards at the same speed (though in practice only one standard at each speed is widely supported). Every device declares its technology abilities, that is, its possible modes of operation. The two devices then choose the best possible mode of operation that are shared by the two devices, where higher speed (100 Mbit/s) is preferred over lower speed (10 Mbit/s), and full duplex is preferred over half duplex at the same speed.
Parallel detection is used when a device that is capable of autonegotiation is connected to one that is not. This happens if the other device does not support autonegotiation or autonegotiation is administratively disabled. In this condition, the device that is capable of autonegotiation can determine and match speed with the other device. This procedure cannot determine the presence of full duplex, so half duplex is always assumed.
The standards for 1000BASE-T and 1000BASE-TX require autonegotiation to be always present and enabled. Other than speed and duplex mode, autonegotiation is used to communicate the port type (single port or multiport) and the master-slave parameters (whether it is manually configured or not, whether the device is master or slave if this is the case, and the master-slave seed bit otherwise).
Autonegotiation is based on pulses similar to those used by 10BASE-T devices to detect the presence of a connection to another device.
协商机制建立在类似于10M检测链接是否建立的脉冲信号机制上, 设备没事的时候就发送这些信号. 这是些单极的正的100ns宽度左右的信号, 16ms来一回. 这些信号叫做 LIT在10M中, 100M中叫NLP.
These pulses are sent by a device when it is not sending or receiving any data. They are unipolar positive-only electrical pulses of a duration of 100 ns nominally with a maximum pulse width of 200 ns[2], generated at intervals of 16 ms (with a tolerance of 8 ms). These pulses were called link integrity test (LIT) pulses in the 10BASE-T terminology, and are referred to as normal link pulses (NLP) in the autonegotiation specification.
1.2 Link status 0,RO/LL Link Status
1 = Valid link is established (for either 10Mbps or 100Mbps
operation)
0 = Link is not established
The link status bit is implemented with a latching function, so
that the occurrence of a link failure condition causes the link
status bit to be cleared and remain cleared until it is read via
the management interface
16.12 BP_ADPOK 0, RW BYPASS ADPOK
Force signal detector (SD) active. This register is for debug
only, not release to customer
1=Forced SD is OK,
0=Normal operation
16.7 F_LINK_100 0, RW Force Good Link in 100Mbps
0 = Normal 100Mbps operation
1 = Force 100Mbps good link status
This bit is useful for diagnostic purposes
18.14 LP_EN 1, RW Link Pulse Enable
1 = Transmission of link pulses enabled
0 = Link pulses disabled, good link condition forced
This bit is valid only in 10Mbps operation
20.13 FORCE_TXSD 0,RW Force Signal Detect
1: force SD signal OK in 100M
0: normal SD signal.