Routers versus Switches
What is a network switch and what is a router? The two pieces of equipment look similar and perform some simila
What is a Network Switch?
To understand basic networking, you first need to answer the question, "What is a network switch?"
Most business networks today use switches to connect computers, printers and servers within a building or campus. A switch serves as a controller, enabling networked devices to talk to each other efficiently. Through information sharing and resource allocation, switches save businesses money and increase employee productivity.
Understand the different types of Ethernet switches and their capabilities.
What is a Network Switch: Unmanaged Switches
An unmanaged switch works right out of the box. It's not designed to be configured, so you don't have to worry about installing or setting it up correctly. Unmanaged switches have less network capacity than managed switches. You'll usually find unmanaged switches in home networking equipment.
What is a Network Switch: Managed Switches
A switch is configurable, offering greater flexibility and capacity than an unmanaged switch. You can monitor and adjust a managed switch locally or remotely, to give you greater network control.
What is a Network Switch versus a Router?
Switches create a network. Routers connect networks. A router links computers to the Internet, so users can share the connection. A router acts as a dispatcher, choosing the best path for information to travel so it's received quickly.
What is a Network Switch to My Business?
Switches and routers are the building blocks for all business communications, from data to voice and video to wireless access. They can improve profitability by enabling your company to increase productivity, trim business expenses, and improve security and customer service.

The Difference Between Hubs, Switches and Routers

Have you ever wondered what the difference is among these boxes? Learn the difference between a router, a switch and a hub.
Some technicians have a tendency to use the terms routers, hubs and switches interchangeably. One minute they're talking about a switch and discussing router settings the next. Throughout the conversation, however, they're still looking at only one box.  Have you ever wondered what the difference is among these boxes? 
Hub, Switch, and Router Defined
The functions of the three devices—the hub , switch and router—are all quite different from one another, even if at times they are all integrated into a single device. Which one do you use when? Let's take a look...
A common connection point for devices in a network. Hubs are commonly used to connect segments of aLAN. A hub contains multiple ports. When a packet arrives at one port, it is copied to the other ports so that all segments of the LAN can see all packets.
In networks, a device that filters and forwards packets between LAN segments. Switches operate at the data link layer (layer 2) and sometimes the network layer (layer 3) of the OSI Reference Model and therefore support any packet protocol. LANs that use switches to join segments are called switched LANs or, in the case of Ethernet networks, switched Ethernet LANs.
A device that forwards data packets along networks. A router is connected to at least two networks, commonly two LANs or WANs or a LAN and its ISP.s network. Routers are located at gateways, the places where two or more networks connect. Routers use headers and forwarding tables to determine the best path for forwarding the packets, and they use protocols such as ICMP to communicate with each other and configure the best route between any two hosts.

The Differences Between Hubs, Switches, and Routers on the Network

Today most routers have become something of a Swiss Army knife, combining the features and functionality of a router and switch/hub into a single unit. So conversations regarding these devices can be a bit misleading — especially to someone new to computer networking.
The functions of a router, hub and a switch are all quite different from one another, even if at times they are all integrated into a single device. Let's start with the hub and the switch since these two devices have similar roles on the network.

The Hub and Switch Have Similar Roles

Each serves as a central connection for all of your network equipment and handles a data type known as frames. Frames carry your data. When a frame is received, it is amplified and then transmitted on to the port of the destination PC. The big difference between these two devices is in the method in which frames are being delivered.
In a hub, a frame is passed along or "broadcast" to every one of its ports. It doesn't matter that the frame is only destined for one port. The hub has no way of distinguishing which port a frame should be sent to. Passing it along to every port ensures that it will reach its intended destination. This places a lot of traffic on the network and can lead to poor network response times.
Additionally, a 10/100Mbps hub must share its bandwidth with each and every one of its ports. So when only one PC is broadcasting, it will have access to the maximum available bandwidth. If, however, multiple PCs are broadcasting, then that bandwidth will need to be divided among all of those systems, which will degrade performance.
A switch, however, keeps a record of the MAC addresses of all the devices connected to it. With this information, a switch can identify which system is sitting on which port. So when a frame is received, it knows exactly which port to send it to, without significantly increasing network response times. And, unlike a hub, a 10/100Mbps switch will allocate a full 10/100Mbps to each of its ports. So regardless of the number of PCs transmitting, users will always have access to the maximum amount of bandwidth. It's for these reasons why a switch is considered to be a much better choice then a hub.

Routers are Completely Different Devices

Routers are completely different devices. Where a hub or switch is concerned with transmitting frames, a router's job, as its name implies, is to route packets to other networks until that packet ultimately reaches its destination. One of the key features of a packet is that it not only contains data, but the destination address of where it's going.
A router is typically connected to at least two networks, commonly two Local Area Networks (LANs) or Wide Area Networks (WAN) or a LAN and its ISP’s network . for example, your PC or workgroup and EarthLink. Routers are located at gateways, the places where two or more networks connect. Using headers and forwarding tables, routers determine the best path for forwarding the packets. Router use protocols such as ICMP to communicate with each other and configure the best route between any two hosts.

Integrated Routers and Features

Today, a wide variety of services are integrated into most broadband routers. A router will typically include a 4 - 8 port Ethernet switch (or hub) and a Network Address Translator (NAT). In addition, they usually include a Dynamic Host Configuration Protocol (DHCP) server, Domain Name Service (DNS) proxy server and a hardware firewall to protect the LAN from malicious intrusion from the Internet.
All routers have a WAN Port that connects to a DSL or cable modem for broadband Internet service and the integrated switch allows users to easily create a LAN. This allows all the PCs on the LAN to have access to the Internet and Windows file and printer sharing services.
Routers might have a single WAN port and a single LAN port and are designed to connect an existing LAN hub or switch to a WAN. Ethernet switches and hubs can be connected to a router with multiple PC ports to expand a LAN. Depending on the capabilities (kinds of available ports) of the router and the switches or hubs, the connection between the router and switches/hubs may require either straight-thru or crossover (null-modem) cables. Some routers even have USB ports, and more commonly, wireless access points built into them.
Some of the more high-end or business class routers will also incorporate a serial port that can be connected to an external dial-up modem, which is useful as a backup in the event that the primary broadband connection goes down, as well as a built in LAN printer server and printer port.
Besides the inherent protection features provided by the NAT, many routers will also have a built-in, configurable, hardware-based firewall. Firewall capabilities can range from the very basic to quite sophisticated devices. Among the capabilities found on leading routers are those that permit configuring TCP/UDP ports for games, chat services, and the like, on the LAN behind the firewall.
So, in short, a hub glues together an Ethernet network segment, a switch can connect multiple Ethernet segments more efficiently and a router can do those functions plus route TCP/IP packets between multiple LANs and/or WANs; and much more of course.

Future Generation Computer Systems

High performance computing often requires computations on large amounts of data that may reside on the cluster computation nodes or on a separate clustered storage system. In order to operate on this data or simply collect the data after a parallel computation, it will require transmission of data over a network. The transmission of data across the network provides an opportunity to do further computation on the data while the data is in transit. We propose taking advantage of this opportunity by embedding compute capabilities into the network in order to do computation on data as it is flowing through the network.
This is the principle behind what we call an active storage network (ASN), a network with embedded computation. The ‘‘active storage'' nomenclature is to indicate that the network works in concert with active storage systems i.e. computation at the storage node. An ASN can enhance storage node performance as well as improve the computational performance of the parallel I/O sys­tems. In this paper, we illustrate the power of an ASN by performing data processing in an intelligent switching system which is built using FPGAs. We demonstrate a few data processing applications, namely data sort, data search, k-min/max, and k-means clustering, and show the performance improvements made by offloading processing from the computation node to the network by comparing the application computation time using an ASN with the computation time when it is performed with a normal switch.
While performing a reduction operation, an ASN switch can perform the operation at the switch level thereby eliminating some of the traffic in the network that could consume the client bandwidth. For example, in a system with 10 storage nodes, if the client wants to perform an operation to find the minimum of a large set of keys stored across these storage nodes, an ASN switch with some computation capabilities could eliminate 90% of the non minimum keys from each node which would be discarded at the client anyway. This allows the switch to send data to the client at full line rate even though it receives data from the storage node in parallel at 10 times the line rate.
As mentioned above, ASNs build upon the active disk concept. In active disks, computation can be offloaded from the processor to the disk. Previous work has demonstrated the effectiveness of this approach particularly with functions such as storage management, data mining, and multimedia. However, the drawback of active disks in a distributed storage setting is that the data is striped across several storage nodes and each processor at the storage node can only see data residing at that node. Thus, any computation at the storage node cannot operate on the entire set of data spread across storage nodes. For example, when doing a query in a database for the k items closest to a particular key, each of the m storage nodes will return the k closest items in its portion of the data. The requesting client must then search through mk items to determine the k closest items overall. The overall com­putation is O(n) + O(mk) where n is the number of data items per storage node. In an ASN, the O(mk) search can be offloaded from the client to the network switch which can perform the search at line speed. Processing the data as it flows through the network essentially means the computation comes for free, since we have to pay for that transmission time anyway.
In an ASN, the goal is to move computation to the network which has a better view of data than the individual storage node, thereby optimizing network performance. Processing ability on the network also eases some of the computational workload at the network client. Most of the applications that operate on large sets of data require transforming the data from one form to another. Examples include file compression, video editing, and data encoding/decoding applications. Offloading data intensive parts of these applications to the network could ease client computing resources. It could also reduce network traffic as some of the data transfer op­erations that read and write data from client to the storage can be avoided. This further provides the impetus to embed data process­ing in a network.
As with an active disk model, the ASN is intended to be programmable. In other words, as the user's application changes the ASN could be reprogrammed to implement specific data processing components. In this paper, we present four specific application kernels, namely data sort, data search, k-min/max, and k-means clustering. However, the ASN can easily be reconfigured to implement many other computational kernels that may be found in HPC applications. One can conceive of a number of possible kernels including reduction operations like average, sum, and compression and transformational operations like FFTs and encryption. A kernel is suitable for implementation in an ASN if the data is stored on distributed nodes and the kernel either does a large scale reduction like a search query or does a data transformation such as a sort.
Some other applications that could benefit from the idea of ASN include redundancy optimizations and file system caching. Parallel I/O systems provide data protection through replication and parity across nodes in the cluster. With the use of an active storage network, the switch can offload parity computations from the client. Distributed file system performance often depends on aggressive caching to reduce network traffic. However, managing a cache across multiple clients can be problematic. ASNs offer an opportunity to present a global cache shared amongst all clients. By placing a centralized cache at the switch, we can free up memory at the client for other purposes. In this paper, we focus on the com­putational aspects of an ASN.

ASN architecture

A critical component of an ASN is the network switch, since the switch implements the data processing on data as it is aggregated and distributed from multiple sources. Typically, custom silicon is used to build gigabit and multi-gigabit switches and these switches offer the best performance. While ASICs could be used to implement the ASN switch, we would lose the ability to reprogram the switch for different application needs. Microprocessors offer programmability but cannot keep up with multi-gigabit speeds in a switch. FPGAs, on the other hand, provide an intermediate design point by offering network processing programmability while still achieving high performance. For this reason, our ASN uses FPGAs to implement the core network switch.
The ASN switch is built using a NetFPGA board designed by Stanford University and Digilent Inc., to help build prototypes of hardware-accelerated networking systems.


NetFPGA architecture

The NetFPGA is a PCI card that contains a Xilinx Virtex-II Pro (XC2VP50) FPGA and is specifically designed for network applications by a research group at Stanford University. It has four 1 Gb/s Ethernet (GigE) interfaces and two SATA ports which make it suit­able to build a switching network. It also has four banks of locally- attached static and dynamic random access memory (SRAM and DRAM). Fig. 1   shows the full resources available on the NetFPGA.

NetFPGA board architecture.

Figure 1

Reference switch pipeline

Fig. 2 shows the design of the reference Ethernet switch provided in the NetFPGA package. It is a five stage pipeline struc­ture where each module communicates using a simple packet based synchronous FIFO push interface which makes it easy to add additional modules to the structure for the purpose of packetprocessing. The user data path is 64 bits wide and it is driven by a 125 MHz clock. Therefore, the switch can handle a maximum throughput of 8 Gb/s i.e. the hardware can process packets at line rate. All packets must pass through all these stages in the switch. The first stage is composed of a series of input queues that receive packets from the I/O ports. The MAC Rx queues and the CPU queues compose this stage. The CPU queues are the queues for the packets received from the PCI over DMA and these queues are not used in our design. The second stage of the reference switch processes the queues in the first stage one by one in round robin order. This input arbiter stage pulls a full packet from one of the input queues and passes the packet on to the next stage for processing. The third stage, output port lookup, reads the packet header received from the previous stage and decides on the appropriate output queue to which this packet needs to be forwarded to. Finally the output queues stage puts the packets in appropriate destination output queues from which the packets are sent out through the Ethernet ports.

NetFPGA switch pipeline

Figure 2

In order to build larger switches, we make use of the NetFPGA SATA ports to interconnect multiple NetFPGA switching elements. Xilinx provides a serial link-layer protocol, called Aurora, that allows the FPGA Rocket I/O transceivers to communicate over the SATA ports. Using the current implementation of the NetFPGA, we can achieve a board-to-board throughput of 2 Gb/s over the SATA ports using Aurora. Thus, each NetFPGA switching element will be able to provide a maximum possible throughput of 8 Gb/s by making use of four 1 Gb/s Ethernet links and two 2 Gb/s SATA ports for the interconnection between switching blocks. In Section 2.3, we briefly describe a switching topology that can fully deliver the maximum possible throughput.

User data processing stage

For the purposes of an ASN, we added an extra stage between the output-port-lookup and output queues stages in the reference switch. This is the stage where special hardware modules are used to handle the data processing tasks. The data processing modules that we have implemented to date are min/max, search, clustering, and sort. The user data processing stage can have one or more of these modules as needed by the overall application. The user data processing stage receives data from the output-port-lookup stage as a stream of Ethernet packets Fig. 3 depicts the data processing units in this stage. Internally, the packets are examined to determine if the packets should be processed by a user module. If so, these packets are sent to the appropriate application module. The user data processing stage can handle data that is not aligned to packets. While adding an extra stage in the pipeline does add to the latency, the increase is insignificant. Since the NetFPGA pipeline runs at 125 MHz, the extra latency is only 8 ns, which is negligible in the context of overall network latency that is usually on the order of10-100 μs.

User data processing stage containing the sort module.

Header parse logic

The nodes and the clients communicate using the user datagram protocol (UDP) protocol, which is a simple connectionless protocol built on IP that does not require prior handshaking before establishing a connection between the client and server. TCP, on the other hand, uses handshaking to establish a reliable connection that comes at the cost of additional header data and slower speed. The architecture does not preclude the use of TCP one could use previous established techniques  to add line speed TCP process­ing as part of the NetFPGA pipeline. However, for simplicity of implementation in our prototype system, we have chosen UDP as the transport protocol. Since UDP does not guarantee packet delivery, client applications using the ASN must take separate measures to provide reliable connections.
Since the NetFPGA currently does not support jumbo frames, the ASN packet size is limited to the standard Ethernet packet size of 1518 bytes. However, the ASN applications that we discuss are scalable to larger packets. The Ethernet, IP, and UDP headers use up 42 bytes of the packet. The six byte ASN header follows, which comprises a magic number and a sequence number Fig. 4 shows the packet header format with an example payload consisting of key-value pairs that would be used in a sort application. The magic number is set to 0x2020, and is used, in conjunction with the UDP port number, by the ASN switch to differentiate ASN application packets from normal packets (e.g. HTTP, SSH, etc.) that are not related to the user application. These normal packets are ignored by the user data processing stage and are routed to their destination without any further processing. We could have used a special UDP port to identify ASN applications, but we chose to preserve the application defined UDP port. In addition to the magic header, an extra 32 bits of packet sequence number is added to assist client applications in managing packet delivery. These 4 bytes of sequence number provide an intermediate solution between full TCP and the simpler UDP protocol.
The header parse logic verifies the packet header for the application port number and the magic header to ascertain that the packet is intended to be processed by the switch. The header parser logic also verifies if the incoming packet is in sequence with the previous stream of packets processed by it. In case of an out of sequence packet, it issues a request to the packet generator logic which in turn sends a request packet to the source requesting for the missing packet.