Ethernet

From Qi-Hardware
Jump to: navigation, search

Ethernet is a standard communication system between local area computers that allows all computers in an Ethernet network are connected to the same line of communication.

Contents

[edit] Basic elements of Ethernet

  • The frame, which is a standardized by the IEEE Standards Association.
  • The media acces control protocol, wich allow multiple computers to acces the shared ethernet channel in a fair manner.
  • The signaling components, which consists of standarized electronic devices that send and recive signals over an ethernet channel.
  • The physical medium, which consists of the cables and other hardware used to carry the digital ethernet signals between computers.

[edit] The Ethernet frame

The frame is defined in the IEEE 802.3 standard. Figure 1 shows the basic frame fields, these field are described bellow.

Figure 1. The Ethernet frame

[edit] The preamble

The ethernet frame begins with a set of 64 bits called preamble, which allows an Ethernet interface of 10 Mbps in the network to synchronize the physical elements to the incoming data stream before arriving data fields. The preamble to implement the recognition signals for all electronic equipment on a 10Mbps Ethernet warning system that will receive data. The preamble exists inorder to allow the beginning of the frame to lose a few bits due to signal start-up delays as it travels through a 10Mbps system. This protedts the rest of the frame from these effects. Inthe 802.3 specification, the preamble field is normally divided into two parts consisting of seven bytes of preamble and one byte, called the start frame delimiter (SFD).

[edit] Destination Address

The destination address field follows the preamble. Each Ethernet interface is assigned a unique 48 bits address, called the interface physical or hardware address. The destination address field contains the 48 bits Ethernet address that corresponds to the address of the interface in the station that is the destiantion of the frame. Each station is scaned in order to know if it can to acept the input signal.

[edit] Source address

The next field in the table is the source address, which contains 48 bits. This is the physical address of the interface sent the frame (MAC Address). A station uses its physical Ethernet address as the source address on any system that transmits.

The source address allows the data entry station to know the direction of the source station to exchange data with it.

[edit] Type field or length field

The next field in the Ethernet frame is either a type field or a length field. This field must identify the network protocol associate with the ethernet frame through the length of data field.

If the value in this field is numerically equal to or less than the maximum untagged frame size in octets of 1518 (decimal), then the field is being used as a length field. In that case, the value in the field indicates the number of logical link control (LCC) data octets that follow in the data field of the frame. If the number of LLC octets is less than the minimum required for the data field of the frame, then octets of pad data will automatically be added to make the data field large enough. The content of pad data is unspecified by the standard. Upon reception of the frame, the length field is used to determine the length of valid data in the data field, and the pad data is discarded.

[edit] Data Field

Next comes the data field of the frame. This field must contain a minimum of 46 bytes of data, and may range up to a maximum of 1500 bytes of data. The network protocol software is expected to provide at least 46 bytes of data.

In the IEEE 802.3, a logical link control (LLC) protocol defined in the IEEE 802.2 LLC standard may ride in the data field of the 802.3 frame to provide control information. The LLC protocol is also used as a way to identify the type of protocol data being carried by the frame if the type/length field is used for length information.

[edit] FCS Field

The last field. It is the frame check sequence (FCS) field, which is also called the cyclic redundancy check, or (CRC). This 32-bit field contains a value that is used to check the integrity of the various bits in the frame fields (not including preamble/SFD). This value is computed using the CRC, which is a polynomial that is calculated using the contents of the destination, source, type (or length), and data fields. As the frame is generated by the transmitting station, the CRC value is simultaneously being calculated. The 32 bits of the CRC value that are the result of this calculation are placed in the FCS field as the frame is sent. The x31 coefficient of the CRC polynomial is sent as the first bit of the field and the x0 coefficient as the last bit. The CRC is calculated again by the interface in the receiving station as the frame is read in. The result of this second calculation is compared with the value sent in the FCS field by the originating station. If the two values are identical, then the receiving station is provided with a high level of assurance that no errors have occurred during transmission over the Ethernet channel.

[edit] Emulating a network

The USB is a very flexible interface for connecting gadgets to computer workstations. If your embedded system is running Linux operating system you can make the most of this Universal Serial Bus. Ben Nano Note doesnt have an Ethernet port but Linux emulates an imaginary Ethernet device using the USB bus as the physical media. There are modules used to implement both the host and device sides required to make communication happen.

Figure 2. Ethernet over USB

This is an authentic network interface so can be assigned an IP address and otherwise treated as though it were ordinary Ethernet Hardware. Once the communication with USB host is established, the respective module allows the USB device to see the Internet (if the Internet is there), ping other IP addresses, and has every benefit you know through Ethernet. In the Ethernet Network the usb-eth interface wont be different from the others because in this network nobody knows they arent using real Ethernet Hardware.

[edit] On the other side

On Linux hosts, this is in the other side of the connection the kernel module that makes Ethernet over USB possible is the usbnet. Once it is installed and the USB connection to the device is established, like we mentioned before, the usbnet module creates an imaginary Ethernet interface that looks like the real thing to the host-side kernel and user applications. The application can check for the presence of the USB device sending a ping to the IP address of the device and if the ping is succesful the device is added.

[edit] Configuration

We assume there isnt any hardware problem and that the network card is working properly. We will explain how to configure it in the Ben NanoNote.

  • Step 1

If you want to configure a network card by first time you need to use the ifconfig command. The IFCONFIG tool is called like that by InterFace CONFIGuration. It allows the operating system to setup network interfaces and allow the user to view information about the configured network interfaces. We enter the next command in the Ben Nano Note:

$ ifconfig usb0 192.168.3.2

In this case the name of the interface is usb followed by the number of the unity and the address assigned. We use usb because we want to use Ethernet over usb.

  • Step 2

We enter the next lines in the Computer where we want to connect the Ben NanoNote:

$ lsusb
Bus 001 Device 006: ID 0525:a4a2 Netchip Technology, Inc. Linux-USB Ethernet/RNDIS Gadget
$ ifconfig usb0 192.168.3.1
$ ifconfig
usb0      Link encap:Ethernet  HWaddr 16:90:89:ea:82:6f  
         inet addr:192.168.3.2  Bcast:192.168.3.255  Mask:255.255.255.0
         inet6 addr: fe80::1490:89ff:feea:826f/64 Scope:Link
         UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
         RX packets:0 errors:0 dropped:0 overruns:0 frame:0
         TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
         collisions:0 txqueuelen:1000 
         RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B

The first command is lsusb (List all Universal Serial Bus devices). It is an utility used to display information about USB buses in the system and the devices connected to them. The second command configures the USB interface in the PC just like we did in the Nano. The third command uses ifconfig again but without any argument so it imply that the console will return a list of information about all available interfaces activated in our system. Just as we expected the usb0 is the network interface that is available and we can see the information about the IP address, the broadcast address, the netmask and other information about data transmission.

  • Step 3

Finally we can ping the PC from the NanoNote via with the next command:

$ ping 192.168.3.2

This command uses the ICMP (Internet Control Message Protocol) protocol's mandatory ECHO_REQUEST datagram to elicit an ICMP ECHO RESPONSE from a gateway or a host like in this case. The ICMP is a protocol used to check if a package cannot get its destiny or if its TTL has expired. The Ping send a message requesting an echo answer to verify the connection established.


[edit] References

We used the contribution about ‘‘Ethernet over USB” published by Uwe Hermann with its respective corrections explaining to a level code the configuration of this network for academical purposes.

Personal tools
Namespaces
Variants
Actions
Navigation
interactive
Toolbox
Print/export