Search This Blog

Friday, 12 December 2014

Switch (Network Switch)

A network switch is a small hardware device that joins multiple computers together within one local area network (LAN). Ethernet switch devices were commonly used on home networks before home routers became popular; broadband routers integrate Ethernet switches directly into the unit as one of their many functions. High-performance network switches are still widely used in corporate networks and data centers.

Network Switch Technology

While switching capabilities exist for several types of networks, Ethernet switches are the most common type. Mainstream Ethernet switches like those inside broadband routers support Gigabit ethernet(1 Gbps) speeds, but high-performance switches like those in data centers generally support 10 Gbps.

Different models of network switches support differing numbers of connected devices. Consumer-grade network switches provide either four or eight connections for Ethernet devices, while corporate switches typically support between 32 and 128 connections. Switches can additionally be connected to each other, a so-called daisy chaining method to add progressively larger number of devices to a LAN.

Network switches operate at layer two (Data Link Layer) of the OSI model.

Network Switches vs. Hubs and Routers

Physically, network switches look nearly identical to network hubs . Switches, unlike hubs, are capable of inspecting data as messages are received via a method called packet switching . A switch determines the source and destination device of each packet and forwards data only to the specific device intended to conserve network bandwidth and generally improve performance compared to hubs.

Ethernet hub

In computer networking, a hub is a small, simple, inexpensive device that joins multiple computers together. Many network hubs available today support the Ethernet standard. Other types including USB hubs also exist, but Ethernet is the type traditionally used in home networking.

Working With Ethernet Hubs

To network a group of computers using an Ethernet hub, first connect an Ethernet cable into the unit, then connect the other end of the cable to each computer's network interface card(NIC).  All Ethernet hubs accept the RJ-45 connectors of standard Ethernet cables.

To expand a network to accommodate more devices, Ethernet hubs can also be connected to each other, to switches, or to routers.

Characteristics of Ethernet Hubs

Ethernet hubs vary in the speed (network data rate or bandwidth ) they support. Some years ago, Ethernet hubs offered only 10 Mbps rated speeds. Newer types of hubs offer 100 Mbps Ethernet. Some support both 10 Mbps and 100 Mbps (so-called dual-speed or 10/100 hubs).

The number of ports an Ethernet hub supports also varies. Four- and five-port Ethernet hubs are most common in home networks, but eight- and 16-port hubs can be found in some home and small office environments.

Older Ethernet hubs were relatively large in size and sometimes noisy as they contained built in fans for cooling the unit. Newer devices are much smaller, designed for mobility, and noiseless.

When To Use an Ethernet Hub

Ethernet hubs operate as Layer 2 devices in the OSI model, the same as network switches. Although offering comparable functionality, nearly all mainstream home network equipment today utilizes network switch technology instead of hubs due to the performance benefits of switches. A hub can be useful for temporarily replacing a broken network switch or when performance is not a critical factor on the network.

Routers

Routers are small physical devices that join multiple networks together. Technically, a router is a Layer 3 gateway device, meaning that it connects two or more networks and that the router operates at the network layer of the OSI model.

Home networks typically use a wireless or wired Internet Protocol (IP) router, IP being the most common OSI network layer protocol. An IP router such as a DSL or cable modem broadband router joins the home's local area network (LAN) to the wide-area network (WAN) of the Internet.

By maintaining configuration information in a piece of storage called the routing table, wired or wireless routers also have the ability to filter traffic, either incoming or outgoing, based on the IP addresses of senders and receivers. Some routers allow a network administrator to update the routing table from a Web browser interface. Broadband routers combine the functions of a router with those of a network switch and a firewall in a single unit.

What Makes a Virtual Private Network Private?

What is a Virtual Private network (VPN)?

Using a public network — usually the Internet — to connect securely to a private network, such as a company's network is the basis of a VPN or virtual private network.

Companies and organizations will use a VPN to communicate confidentially over a public network and to send voice, video or data. It is also an excellent option for remote workers and organizations with global offices and partners to share data in a private manner.

One of the most common types of VPNs is a virtual private dial-up network (VPDN). A VPDN is a user-to-LAN connection, where remote users need to connect to the company LAN. Here the company will have a service provider set-up a NAS (network access server) and provide the remote users with the software needed to reach the NAS from their desktop computer or laptop. For a VPDN, the secure and encrypted connection between the company's network and remote users is provided by the third-party service provider.

Another type of VPN is commonly called a site-to-site VPN. Here the company would invest in dedicated hardware to connect multiple sites to their LAN though a public network, usually the Internet. Site-to-site VPNs are either intranet or extranet-based.
intranet

A network based on TCP/IP protocols (an intranet) belonging to an organization, usually a corporation, accessible only by the organization's members, employees or others with authorization. Secure intranets are now the fastest-growing segment of the Internet because they are much less expensive to build and manage than private networks based on proprietary protocols.

Extranet

An extranet refers to an intranet that is partially accessible to authorized outsiders. Whereas an intranet resides behind a firewall and is accessible only to people who are members of the same company or organization, an extranet provides various levels of accessibility to outsiders. You can access an extranet only if you have a valid username and password, and your identity determines which parts of the extranet you can view. Extranets are becoming a popular means for business partners to exchange information.

Other options for using a VPN include such things as using dedicated private leased lines. Due to the high cost of dedicated lines, however, VPNs have become an attractive cost-effective solution.

Securing a VPN

If you're using a public line to connect to a private network, then you might wonder what makes a virtual private network private? The answer is the manner in which the VPN is designed. A VPN is designed to provides a secure, encrypted tunnel in which to transmit the data between the remote user and the company network. The information transmitted between the two locations via the encrypted tunnel cannot be read by anyone else.

VPN security contains several elements to secure both the company's private network and the outside network, usually the Internet, through which the remote user connects through. The first step to security is usually a firewall. You will have a firewall site between the client (which is the remote users workstation) and the host server, which is the connection point to the private network. The remote user will establish an authenticated connection with the firewall.
 
VPN Encryption

Encryption is also an important component of a secure VPN. Encryption works by having all data sent from one computer encrypted in such a way that only the computer it is sending to can decrypt the data. Types of encryption commonly used include public-key encryption which is a system that uses two keys — a public key known to everyone and a private or secret key known only to the recipient of the message. The other commonly used encryption system is a Symmetric-key encryption system in which the sender and receiver of a message share a single, common key that is used to encrypt and decrypt the message.

VPN Tunneling

With a VPN you'll need to establish a network connection that is based on the idea of tunneling. There are two main types of tunneling used in virtual private networks. Voluntary tunneling is where the client makes a connection to the service provider then the VPN client creates the tunnel to the VPN server once the connection has been made. In compulsory tunneling the service provider manages the VPN connection and brokers the connection between that client and a VPN server.

There are three main network protocols for use with VPN tunnels, which are generally incompatible with each other. They include the following
 
IPSec

A set of protocols developed by the IETF to support secure exchange of packets at the IP layer. IPsec has been deployed widely to implement VPNs. IPsec supports two encryption modes: Transport and Tunnel. Transport mode encrypts only the data portion (payload) of each packet, but leaves the header untouched. The more secure Tunnel mode encrypts both the header and the payload. On the receiving side, an IPSec-compliant device decrypts each packet. For IPsec to work, the sending and receiving devices must share a public key. This is accomplished through a protocol known as Internet Security Association and Key Management Protocol/Oakley (ISAKMP/Oakley), which allows the receiver to obtain a public key and authenticate the sender using digital certificates.
 
PPTP

Short for Point-to-Point Tunneling Protocol, a new technology for creating VPNs, developed jointly by Microsoft, U.S. Robotics and several remote access vendor companies, known collectively as the PPTP Forum. A VPN is a private network of computers that uses the public Internet to connect some nodes. Because the Internet is essentially an open network, PPTP is used to ensure that messages transmitted from one VPN node to another are secure. With PPTP, users can dial in to their corporate network via the Internet.
 
L2TP

Short for Layer Two (2) Tunneling Protocol, an extension to the PPP protocol that enables ISPs to operate Virtual Private Networks (VPNs). L2TP merges the best features of two other tunneling protocols: PPTP from Microsoft and L2F from Cisco Systems. Like PPTP, L2TP requires that the ISP's routers support the protocol.
 
VPN Equipment

Depending on the type of VPN you decide to implement, either remote-access or site-to-site, you will need specific components to build your VPN. These standard components include a software client for each remote workstation, dedicated hardware, such as a firewall  or a product like the Cisco VPN Concentrator, a VPN server, and a  Network Access Server (NAS).
Key Terms To Understanding  virtual private networks:

VPN
 
A network that is constructed by using public wires to connect nodes. For example, there are a number of systems that enable you to create networks using the Internet as the medium for transporting data.

VPDN
 
A network that extends remote access to a private network using a shared infrastructure.

tunneling
 
A technology that enables one network to send its data via another network's connections. Tunneling works by encapsulating a network protocol within packets carried by the second network.

split tunneling

The process of allowing a remote VPN user to access a public network, most commonly the Internet, at the same time that the user is allowed to access resources on the VPN.

encryption

The translation of data into a secret code. Encryption is the most effective way to achieve data security. To read an encrypted file, you must have access to a secret key or password that enables you to decrypt it. There are two main types of encryption: asymmetric encryption (also called public-key encryption) and symmetric encryption.

802.11b

802.11b is a Wi-Fi wireless network communication technology. It is one of the 802.11 series of IEEE standard technologies and was widely used in first-generation Wi-Fi home networking products after its introduction in 1999. 802.11b has since been rendered obsolete by the newer Wi-Fi standards 802.11g and 802.11n.

802.11b Performance
 
802.11b LANs support a theoretical maximum data rate of 11mbps. Although comparable to traditional Ethernet (10 Mbps), its performs significantly slower than newer Wi-Fi and Ethernet technologies including 802.11g and Fast Ethernet.

802.11b and Wireless Interference

Transmitting in the unregulated 2.4 GHz frequency range (like 802.11g), 802.11b transmitters can encounter radio interference from other wireless household products like cordless telephones, microwave ovens, garage door openers, and baby monitors.

802.11a

802.11a is a Wi-Fi wireless network communication standard. It is one of the IEEE standards in the 802.11 series.
 
802.11a Performance

An 802.11a wireless network supports a maximum theoretical bandwidth of 54 Mbps, a noticeable advantage over 802.11b Wi-Fi that supports 11 Mbps and on par with 802.11g performance. However, 802.11a installations historically were limited to corporate environments due to comparatively higher hardware equipment costs.
 
802.11a and Wireless Interference

802.11a transmits radio signals in the frequency range above 5 GHz, a part of wireless spectrum regulated in many countries. This regulation means 802.11a gear generally avoids signal interference from other consumer wireless products like cordless phones. In contrast, 802.11b/g utilizes frequencies in the unregulated 2.4 GHz range and is much more susceptible to radio interference from other devices.

Range of 802.11a Networks
 
Though it helps improve network performance and reduce interference, the range of an 802.11a signal is limited by use of the high 5 GHz frequency. An 802.11a access point transmitter may cover less than one-fourth the area of a comparable 802.11b/g unit. Brick walls and other obstructions affect 802.11a wireless networks to a greater degree than they do comparable 802.11b/g networks.

Wi-Fi

Wi-Fi is the industry name for wireless local area network (WLAN) communication technology related to the IEEE 802.11 family of wireless networking standards. Wi-Fi technology first became popular with 802.11b, introduced in 1999 and the first standard in that family to enjoy mainstream adoption. Today, Wi-Fi refers to any of the established standards:
  •  802.11a
  •  802.11b
  •  802.11g
  •  802.11n
  •  802.11ac

The Wi-Fi Alliance certifies vendor equipment to ensure 802.11 products on the market follow the various 802.11 specifications. Consumer versions of Wi-Fi products have additionally maintained backward compatibility. For example, 802.11b, 802.11g, and 802.11n equipment all can communicate with each other, and mixed Wi-Fi networks with devices running multiple of these standards are commonly referred to as "802.11b/g/n" networks. 802.11ac equipment also communicates with each of these others. The old 802.11a technology is not compatible with these others and has fallen out of mainstream usage as a result.

Thursday, 11 December 2014

VPN – virtual private network

VPN is a network that is constructed by using public wires — usually the Internet — to connect to a private network, such as a company's internal network.  There are a number of systems that enable you to create networks using the Internet as the medium for transporting data. These systems use encryption and other security mechanisms to ensure that only authorized users can access the network and that the data cannot be intercepted.

Consumer VPN Services

Consumers use a private VPN service, also known as a VPN tunnel, to protect their online activity and identity. By using an anonymous VPN service, a user's Internet traffic and data remain encrypted, which prevents eavesdroppers from sniffing Internet activity.  A VPN service is especially useful when accessing public Wi-Fi hotspots because the public wireless services might not be secure. In addition to public Wi-Fi security, a private VPN service also provides consumers with uncensored Internet access and can help prevent data theft and unblock websites.

Corporate VPN Communications

Companies and organizations will use a VPN to communicate confidentially over a public network and to send voice, video or data. It is also an excellent option for remote workers and organizations with global offices and partners to share data in a private manner.

One of the most common types of VPNs used by businesses is called a virtual private dial-up network (VPDN). A VPDN is a user-to-LAN connection, where remote users need to connect to the company LAN. Another type of VPN is commonly called a site-to-site VPN. Here the company would invest in dedicated hardware to connect multiple sites to their LAN though a public network, usually the Internet.

What Is a Mesh Network?

In computer networking, a mesh is one kind of network topology.

Types of Mesh Networks

Mesh networking has become increasingly popular in recent years with the growth of Wi-Fi and outdoor wireless networks. Although mesh networks can also be built using cables, it is more cost effective and easier to scale a mesh using wireless connection technologies. Several different categories of mesh networks exist including:
  • community networks - connecting neighborhoods for more efficient sharing of network bandwidth and better social interaction
  • municipal networks - infrastructure for law enforcement and protected sharing of local government services
  • ad-hoc wireless networks - connections created "on-the-fly" among a small number of devices, often for file sharing between friends away from home

Mesh Network Basic Technologies
Beside the protocols and applications used in standard wired and wireless networking, several technologies have been created specifically for the purpose of mesh networking:
  • 802.11s, a standard being developed for ad-hoc Wi-Fi meshes
  • home automation network protocols like INSTEON, Z-Wave, and ZigBee
  • spanning trees, algorithms for managing data flow on traditional mesh networks

Building Mesh Networks
Many mesh networks use wireless routers installed at fixed locations to cover a building or specific outdoor area. Ad hoc meshes do not require access points but instead utilize the network protocol support of computer operating systems. Wired meshes utilize additional cables between wired routers.

Monday, 8 September 2014

IP Version 6 (IPv6)

IPv6 or Internet Protocol Version 6 is the next generation protocol for the Internet. It's designed to provide several advantages over current Internet Protocol Version 4 (or IPv4).

To deal with scaling problems caused by the Internet’s massive growth. Subnetting and CIDR have helped to contain the rate at which the Internet address space is being consumed (the address depletion problem) and have also helped to control the growth of routing table information needed in the Internet’s routers (the routing information problem). However, there will come a point at which these techniques are no longer adequate.

It is virtually impossible to achieve 100% address utilization efficiency, so the address space will be exhausted well before the four-billionth host is connected to the Internet.

Pv6 addresses the main problem of IPv4, that is, the exhaustion of addresses to connect computers or host in a packet-switched network. IPv6 has a very large address space and consists of 128 bits as compared to 32 bits in IPv4.

Therefore, it is now possible to support 2^128 unique IP addresses, a substantial increase in number of computers that can be addressed with the help of IPv6 addressing scheme.

IETF started work on a new version of IP, one which would never run out of addresses, would solve a variety of other problems, and be more flexible and efficient as well. 

Its major goals were:
  1. Support billions of hosts, even with inefficient address space allocation.
  2. Reduce the size of the routing tables. 
  3. Simplify the protocol, to allow routers to process packets faster.
  4. Provide better security (authentication and privacy) than current IP.
  5. Pay more attention to type of service, particularly for real-time data.
  6. Aid multicasting by allowing scopes to be specified.
  7. Make it possible for a host to roam without changing its address.
  8. Allow the protocol to evolve in the future.
  9. Permit the old and new protocols to coexist for years.
To develop a protocol that met all these requirements, IETF issued a call for proposals and discussion in RFC 1550. Twenty-one responses were received, not all of them full proposals. By December 1992, seven serious proposals were on the table. They ranged from making minor patches to IP, to throwing it out altogether and replacing with a completely different protocol.

One proposal was to run TCP over CLNP, which, with its 160-bit addresses would have provided enough address space forever and would have unified two major network layer protocols. However, many people felt that this would have been an admission that something in the OSI world was actually done right, a statement considered Politically Incorrect in Internet circles. CLNP was patterned closely on IP, so the two are not really that different. In fact, the protocol ultimately chosen differs from IP far more than CLNP does. Another strike against CLNP was its poor support for service types, something required to transmit multimedia efficiently.
 
Three of the better proposals were published in IEEE Network (Deering, 1993; Francis, 1993; and Katz and Ford, 1993). After much discussion, revision, and jockeying for position, a modified combined version of the Deering and Francis proposals, by now called SIPP (Simple Internet Protocol Plus) was selected and given the designation IPv6.

First and foremost, IPv6 has longer addresses than IPv4. They are 16 bytes long, which solves the problem that IPv6 set out to solve: provide an effectively unlimited supply of Internet addresses. We will have more to say about addresses shortly.

The second major improvement of IPv6 is the simplification of the header. It contains only seven fields (versus 13 in IPv4). This change allows routers to process packets faster and thus improve throughput and delay.

The third major improvement was better support for options. This change was essential with the new header because fields that previously were required are now optional. In addition, the way options are represented is different, making it simple for routers to skip over options not intended for them. This feature speeds up packet processing time.

A fourth area in which IPv6 represents a big advance is in security. IETF had its fill of newspaper stories about precocious 12-year-olds using their personal computers to break into banks and military bases all over the Internet. There was a strong feeling that something had to be done to improve security. Authentication and privacy are key features of the new IP. These were later retrofitted to IPv4, however, so in the area of security the differences are not so great any more.

Finally, more attention has been paid to quality of service. Various half-hearted efforts have been made in the past, but now with the growth of multimedia on the Internet, the sense of urgency is greater.


Version: The 4-bit version field contains the number 6. It indicates the version of the IPv6 protocol.

Traffic Class: The Traffic class field is used to distinguish between packets with different real-time delivery requirements. A field designed for this purpose has been in IP since the beginning, but it has been only sporadically implemented by routers. 

Flow Label/QoS management (20 bits): The 20-bit flow label field in the IPv6 header can be used by a source to label a set of packets belonging to the same flow. A flow is uniquely identified by the combination of the source address and of a non-zero Flow label. Multiple active flows may exist from a source to a destination as well as traffic that are not associated with any flow (Flow label = 0).

Payload length: The Payload length field tells how many bytes follow the 40-byte header

Next Header (8 bits): The 8-bit Next Header field identifies the type of header immediately following the IPv6 header and located at the beginning of the data field (payload) of the IPv6 packet. This field usually specifies the transport layer protocol used by a packet's payload. The two most common kinds of Next Headers are TCP (6) and UDP (17), but many other headers are also possible. 

Time To Live (TTL)/Hop Limit (8 bits):  The 8-bit Hop Limit field is decremented by one, by each node (typically a router) that forwards a packet. If the Hop Limit field is decremented to zero, the packet is discarded. 

A new notation has been devised for writing 16-byte addresses. They are written as eight groups of four hexadecimal digits with colons between the groups, like this:

8000:0000:0000:0000:0123:4567:89AB:CDEF

Since many addresses will have many zeros inside them, three optimizations have been authorized. First, leading zeros within a group can be omitted, so 0123 can be written as 123. Second, one or more groups of 16 zero bits can be replaced by a pair of colons. Thus, the above address now becomes

8000::123:4567:89AB:CDEF

Finally, IPv4 addresses can be written as a pair of colons and an old dotted decimal number, for example

::192.31.20.46

Extension Headers

Some of the missing IPv4 fields are occasionally still needed, so IPv6 has introduced the concept of an (optional) extension header. These headers can be supplied to provide extra information, but encoded in an efficient way. Six kinds of extension headers are defined at present. Each one is optional, but if more than one is present, they must appear directly after the fixed header, and preferably in the order listed.


Interdomain Routing (Border Gateway Protocol)

Internet is organized as autonomous systems, each of which is under the control of a single administrative entity. The Border Gateway Protocol (BGP) is an interautonomous system routing protocol. An autonomous system is a network or group of networks under a common administration and with common routing policies. BGP is used to exchange routing information for the Internet and is the protocol used between Internet service providers (ISP).


The basic idea behind autonomous systems is to provide an additional way to hierarchically aggregate routing information in a large internet, thus improving scalability. 

We divide the routing problem into two parts: routing within a single autonomous system and routing between autonomous systems. another name for autonomous systems in the Internet is routing domains, we refer to the two parts of the routing problem as interdomain routing and intradomain routing.

There have been two major interdomain routing protocols in the recent history of the Internet. The first was the Exterior Gateway Protocol (EGP). EGP had a number of limitations, perhaps the most severe of which was that it constrained the topology of the Internet rather significantly. EGP basically forced a treelike topology onto the Internet, or to be more precise, it was designed when the Internet had a treelike topology,there is a single backbone, and autonomous systems are connected only as parents and children and not as peers.

The replacement for EGP is the Border Gateway Protocol (BGP), which is in its fourth version at the time of this writing (BGP-4).

BGP assumes that the Internet is an arbitrarily interconnected set of ASs. This model is clearly general enough to accommodate non-treestructured internetworks, like the simplified picture of today’s multibackbone Internet shown in Figure.


Today’s Internet consists of an interconnection of multiple backbone networks and sites are connected to each other in arbitrary ways. Some large corporations connect directly to one or more of the backbones, while others connect to smaller, nonbackbone service providers.

Given this rough sketch of the Internet, if we define local traffic as traffic that originates at or terminates on nodes within an AS, and transit traffic as traffic that passes through an AS, we can classify ASs into three types:

  •  Stub AS: an AS that has only a single connection to one other AS; such an AS will only carry local traffic. The small corporation in Figure is an example of a stub AS.
  •  Multihomed AS: an AS that has connections to more than one other AS but that refuses to carry transit traffic; for example, the large corporation at the top of Figure.
  •  Transit AS: an AS that has connections to more than one other AS and that is designed to carry both transit and local traffic, such as the backbone providers in Figure.

Finding optimal paths based on minimizing some sort of link metric, the problem of interdomain routing turns out to be so difficult that the goals are more modest. First and foremost, the goal is to find any path to the intended destination that is loop-free. We are more concerned with reachability than optimality. Finding a path that is anywhere close to optimal is considered a great achievement.

When configuring BGP, the administrator of each AS picks at least one node to be a “BGP speaker,” which is essentially a spokesperson for the entire AS. That BGP speaker establishes BGP sessions to other BGP speakers in other ASs. These sessions are used to exchange reachability information among ASs.the BGP speakers, the AS has one or more border “gateways,” which need not be the same as the speakers. The border gateways are the routers through which packets enter and leave the AS.

BGP advertises complete paths as an enumerated list of ASs to reach a particular network. This is necessary to enable the sorts of policy decisions described above to be made in accordance with the wishes of a particular AS. It also enables routing loops to be readily detected.

We should note that a given AS will only advertise routes that it considers good enough for itself. That is, if a BGP speaker has a choice of several different routes to a destination, it will choose the best one according to its own local policies, and then that will be the route it advertises. Furthermore, a BGP speaker is under no obligation to advertise any route to a destination, even if it has one. This is how an AS can implement
a policy of not providing transit—by refusing to advertise routes to prefixes that are not contained within that AS, even if it knows how to reach them.

In addition to advertising paths, BGP speakers need to be able to cancel previously advertised paths if a critical link or node on a path goes down. This is done with a form of negative advertisement known as a withdrawn route. Both positive and negative reachability information are carried in a BGP update message, the format of which is shown in Figure.


BGP-4 update packet format.

Wednesday, 27 August 2014

Link State Routing (OSPF)

Link-state routing is the second major class of intradomain routing protocol. The basic idea behind link-state protocols is very simple: Every node knows how to reach its directly connected neighbors, and if we make sure that the totality of this knowledge is disseminated to every node, then every node will have enough knowledge of the network to build a complete map of the network. This is clearly a sufficient condition (although not a necessary one) for finding the shortest path to any point in the network.

link-state routing protocols rely on two mechanisms: reliable dissemination of link-state information, and the calculation of routes from the sum of all the accumulated link-state knowledge.

Reliable Flooding

Reliable flooding is the process of making sure that all the nodes participating in the routing protocol get a copy of the link-state information from all the other nodes. As the term “flooding” suggests, the basic idea is for a node to send its link-state information out on all of its directly connected links, with each node that receives this information forwarding it out on all of its links. This process continues until the information has reached all the nodes in the network.

each node creates an update packet, also called a link-state packet (LSP), that contains the following information:

  • the ID of the node that created the LSP
  • a list of directly connected neighbors of that node, with the cost of the link to each one
  • a sequence number
  • a time to live for this packet

Consider a node X that receives a copy of an LSP that originated at some other node Y. Note that Y may be any other router in the same routing domain as X. X checks to see if it has already stored a copy of an LSP from Y. If not, it stores the LSP. If it already has a copy, it compares the sequence numbers; if the new LSP has a larger sequence number, it is assumed to be the more recent, and that LSP is stored, replacing the old one. A smaller (or equal) sequence number would imply an LSP older (or not newer) than the one stored, so it would be discarded and no further action would be needed. If the received LSP was the newer one, X then sends a copy of that LSP to all of its neighbors except the neighbor from which the LSP was just received. The fact that the LSP is not sent back to the node from which it was received helps to bring an end to the flooding of an LSP. Since X passes the LSP on to all its neighbors, who then turn around and do the same thing, the most recent copy of the LSP eventually reaches all nodes.

Each node generates LSPs under two circumstances. Either the expiry of a periodic timer or a change in topology can cause a node to generate a new LSP. However, the only topology-based reason for a node to generate an LSP is if one of its directly connected links or immediate neighbors has gone down. The failure of a link can be detected in some cases by the link-layer protocol. The demise of a neighbor or loss of connectivity to that neighbor can be detected using periodic “hello” packets. Each node sends these to its immediate neighbors at defined intervals. If a sufficiently long time passes without receipt of a “hello” from a neighbor, the link to that neighbor will be declared down, and a new LSP will be generated to reflect this fact. One of the important design goals of a link-state protocol’s flooding mechanism is that the newest information must be flooded to all nodes as quickly as possible, while old information must be removed from the network and not allowed to circulate.

Route Calculation

Once a given node has a copy of the LSP from every other node, it is able to compute a complete map for the topology of the network, and from this map it is able to decide the best route to each destination. The question, then, is exactly how it calculates routes from this information. The solution is based on a well-known algorithm from graph theory—Dijkstra’s shortest-path algorithm.

The algorithm is defined as follows:

M = {s}
for each n in N− {s}
C(n) = l(s, n)
while (N = M)
M = M ∪ {w} such that C(w) is the minimum for all w in (N− M)
for each n in (N− M)
C(n) = MIN(C(n), C(w) + l(w, n))

Each switch computes its routing table directly from the LSPs it has collected using a realization of Dijkstra’s algorithm called the forward search algorithm. Specifically, each switch maintains two lists, known as Tentative and Confirmed. Each of these lists contains a set of entries of the form (Destination, Cost, NextHop).

The algorithm works as follows:
  1. Initialize the Confirmed list with an entry for myself; this entry has a cost of 0.
  2. For the node just added to the Confirmed list in the previous step, call it node Next, select its LSP.
  3. For each neighbor (Neighbor) of Next, calculate the cost (Cost) to reach this Neighbor as the sum of the cost from myself to Next and from Next to Neighbor. 
    • If Neighbor is currently on neither the Confirmed nor the Tentative list, then add (Neighbor, Cost, NextHop) to the Tentative list, where NextHop is the direction I go to reach Next. 
    • If Neighbor is currently on the Tentative list, and the Cost is less than the currently listed cost for Neighbor, then replace the current entry with (Neighbor, Cost, NextHop), where NextHop is the direction I go to reach Next.
  4. If the Tentative list is empty, stop. Otherwise, pick the entry from the Tentative list with the lowest cost, move it to the Confirmed list, and return to step 2.

The link-state routing algorithm has many nice properties: It has been proven to stabilize quickly, it does not generate much traffic, and it responds rapidly to topology changes or node failures. On the downside, the amount of information stored at each node (one LSP for every other node in the network) can be quite large.

The Open Shortest Path First Protocol (OSPF)

One of the most widely used link-state routing protocols is OSPF. The first word, “Open,” refers to the fact that it is an open, nonproprietary standard, created under the auspices of the IETF. The “SPF” part comes from an alternative name for linkstate routing.
 


LS age - The time, in seconds, since the LSA was generated. 
LSID (Link State ID) - The ID of the router that generated the LSA. 
Advertising Router - ID of the router that originated the LSA.
LS Seq (Link State Sequence) - The sequence number of the advertisement. Used to detect old or duplicate link state advertisements.  
Flags - Possible values:
  • V - Router is the endpoint of an active virtual link that is using the area as a transit area. 
  • ASBR - Router is an autonomous system boundary router (ASBR). 
  • ABR - Router is an area border router (ABR).

 Link ID - Identifies the object to which this router link connects for each Link Type. Possible values:
  •     If Link Type is PTP, then this is the neighboring router's router ID.
  •     If Link Type is Transit, then this is the address of the designated router.
  •     If Link Type is Stub, then this is the IP network or subnetwork number.
  •     If Link Type is Virtual Link, then this is the neighboring router's router ID.
Link Data - Provides additional link information. Possible values:
  •     If Link Type is PTP, then this is the MIB II index value for an unnumbered point-to-point interface.
  •     If Link Type is Transit, then this is the IP address of the advertising router's interface.
  •     If Link Type is Stub, then this is the network's IP address mask.
  •     If Link Type is Virtual Link, then this is the IP address mask of the neighboring router.
Link Type - A description of the router link. Possible values:
  •    PTP - Connection is point-to-point to another router.
  •    Transit - Connection is to a transit network.
  •    Stub - Connection to a stub network.
  •    Virtual link - Connection is to a far-end router that is the endpoint of a virtual link.
Metric - Cost of using this outbound router link. With the exception of stub networks, this value must be other than 0. 
 
NUM_TOS :TOS information is present to allow OSPF to choose different routes for IP packets based on the value in their TOS field.

Distance-Vector Routing

Each node constructs a one-dimensional array containing the "distances"(costs) to all other nodes and distributes that vector to its immediate neighbors.
  1. The starting assumption for distance-vector routing is that each node knows the cost of the link to each of its directly connected neighbors.
  2. A link that is down is assigned an infinite cost.
To see how a distance-vector routing algorithm works, it is easiest to consider an example 

Distance-vector routing: an example network.

In this example, the cost of each link is set to 1, so that a least-cost path is simply the one with the fewest hops. We can represent each node’s knowledge about the distances to all other nodes as a table like the one given in Table. Note that each node only knows the information in one row of the table. The global view that is presented here is not available at any single point in the network.




Table 1: Initial distances stored at each node (global view).

We may consider each row in Table 1 as a list of distances from one node to all other nodes, representing the current beliefs of that node. Initially, each node sets a cost of 1 to its directly connected neighbors and ∞ to all other nodes. Thus, A initially believes that it can reach B in one hop and that D is unreachable. The routing table stored at A reflects this set of beliefs and includes the name of the next hop that A would use to reach any reachable node. 

Table2: Initial routing table at node A.

Initially, then, A’s routing table would look like Table 2.The next step in distance-vector routing is that every node sends a message to its directly connected neighbors containing its personal list of distances.


Table 3: Final routing table at node A.

For example, node F tells node A that it can reach node G at a cost of 1; A also knows it can reach F at a cost of 1, so it adds these costs to get the cost of reaching G by means of F. This total cost of 2 is less than the current cost of infinity, so A records that it can reach G at a cost of 2 by going through F. Similarly, A learns from C that D can be reached from C at a cost of 1; it adds this to the cost of reaching C (1) and decides that D can be reached via C at a cost of 2, which is better than the old cost of infinity. At the same time, A learns from C that B can be reached from C at a cost of 1, so it concludes that the cost of reaching B via C is 2. Since this is worse than the current cost of reaching B (1), this new information is ignored.

Node A can update its routing table with costs and next hops for all nodes in the network and  The result is shown in Table 3

If there is any topology changes, it only takes a few exchanges of information between neighbors before each node has a complete routing table. The process of getting consistent routing information to all the nodes is called convergence.

There are two different circumstances under which a given node decides to send a routing update to its neighbors.

One of these circumstances is the periodic update. each node automatically sends an update message every time interval, even nothing has changed.The frequency of these periodic updates varies from protocol to protocol.

The second mechanism, sometimes called a triggered update, happens whenever a node receives an update from one of its neighbors that causes it to change one of the routes in its routing table. That is, whenever a node’s routing table changes, it sends an update to its neighbors, which may lead to a change in their tables, causing them to send an update to their neighbors.

Final distances stored at each node (global view).

When a node detects a link failure
  • F detects that link to G has failed
  • F sets distance to G to infinity and sends update to A
  • A sets distance to G to infinity since it uses F to reach G
  • A receives periodic update from C with 2-hop path to G
  • A sets distance to G to 3 and sends update to F
  • F decides it can reach G in 4 hops via A
Slightly different circumstances can prevent the network from stabilizing.Suppose the link from A to E goes down. In the next round of updates, A advertises a distance of infinity to E, but B and C advertise a distance of 2 to E. Depending on the exact timing of events, the following might happen.
  • Node B, upon hearing that E can be reached in 2 hops from C, concludes that it can reach E in 3 hops and advertises this to A
  • Node A concludes that it can reach E in 4 hops and advertises this to C
  • Node C concludes that it can reach E in 5 hops; and so on.
  • This cycle stops only when the distances reach some number that is large enough to be considered infinite
  • This problem is called as Count-to-infinity problem
 There are several partial solutions to this problem. The first one is to use some relatively small number as an approximation of infinity. For example, we might decide that the maximum number of hops to get across a certain network is never going to be more than 16, and so we could pick 16 as the value that represents infinity. This at least bounds the amount of time that it takes to count to infinity.

One technique to improve the time to stabilize routing is called split horizon. The idea is that when a node sends a routing update to its neighbors, it does not send those routes it learned from each neighbor back to that neighbor.For example, if B has the route (E, 2, A) in its table, then it knows it must have learned this route from A, and so whenever B sends a routing update to A, it does not include the route (E, 2) in that update.In a stronger variation of split horizon, called split horizon with poison reverse, B actually sends that route back to A, but it puts negative information in the route to ensure that A will not eventually use B to get to E.



Routing Information Protocol (RIP)

One of the most widely used routing protocols in IP networks is the Routing Information Protocol (RIP). RIP is the canonical example of a routing protocol built on the distance-vector algorithm.

RIP Packet Format

RIP is in fact a fairly straightforward implementation of distance-vector routing. Routers running RIP send their advertisements every 30 seconds; a router also sends an update message whenever an update from another router causes it to change its routing table. One point of interest is that it supports multiple address families, not just IP. The network-address part of the advertisements is actually represented as a family, address pair. RIP version 2 (RIPv2) also has some features related to scalability

Wednesday, 13 August 2014

Dynamic Host Configuration Protocol (DHCP)

We observed that Ethernet addresses are configured into the network adaptor by the manufacturer, and this process is managed in such a way to ensure that these addresses are globally unique. This is clearly a sufficient condition to ensure that any collection of hosts connected to a single Ethernet (including an extended LAN) will have unique addresses. Furthermore, uniqueness is all we ask of Ethernet addresses.

IP addresses, by contrast, not only must be unique on a given internetwork, but also must reflect the structure of the internetwork. They contain a network part and a host part, and the network part must be the same for all hosts on the same network. It is not possible for the IP address to be configured once into a host when it is manufactured, since that would imply that the manufacturer knew which hosts were going to end up on which networks, and it would mean that a host, once connected to one network, could never move to another. For this reason, IP addresses need to be reconfigurable.

Most host operating systems provide a way for a system administrator, or even a user, to manually configure the IP information needed by a host. However, there are some obvious drawbacks to such manual configuration.

It is simply a lot of work to configure all the hosts in a large network directly, especially when you consider that such hosts are not reachable over a network until they are configured. Even more importantly, the configuration process is very error-prone, since it is necessary to ensure that every host gets the correct network number and that no two hosts receive the same IP address. For these reasons, automated configuration methods are required. The primary method uses a protocol known as the Dynamic Host Configuration Protocol (DHCP).

DHCP relies on the existence of a DHCP server that is responsible for providing configuration information to hosts. There is at least one DHCP server for an administrative domain. At the simplest level, the DHCP server can function just as a centralized repository for host configuration information.

A more sophisticated use of DHCP saves the network admininstrator from even having to assign addresses to individual hosts. In this model, the DHCP server maintains a pool of available addresses that it hands out to hosts on demand. This considerably reduces the amount of configuration an administrator must do, since now it is only necessary to allocate a range of IP addresses (all with the same network number) to each network.
Since the goal of DHCP is to minimize the amount of manual configuration required for a host to function, it would rather defeat the purpose if each host had to be configured with the address of a DHCP server. Thus, the first problem faced by DHCP is that of server discovery.

To contact a DHCP server, a newly booted or attached host sends a DHCPDISCOVER message to a special IP address (255.255.255.255) that is an IP broadcast address. This means it will be received by all hosts and routers on that network. (Routers do not forward such packets onto other networks, preventing broadcast to the entire Internet.) In the simplest case, one of these nodes is the DHCP server for the network. The server would then reply to the host that generated the discovery message (all the other nodes would ignore it). However, it is not really desirable to require one DHCP server on every network because this still creates a potentially large number of servers that need to be correctly and consistently configured. Thus, DHCP uses theconcept of a relay agent. There is at least one relay agent on each network, and it is configured with just one piece of information: the IP address of the DHCP server. When a relay agent receives a DHCPDISCOVER message, it unicasts it to the DHCP server and awaits the response, which it will then send back to the requesting client. The process of relaying a message from a host to a remote DHCP server is shown



A DHCP relay agent receives a broadcast DHCPDISCOVER message from a host and sends a unicast DHCPDISCOVER message to the DHCP server.

Figure shows the format of a DHCP message. The message is actually sent using a protocol called UDP (the User Datagram Protocol) that runs over IP. 

DHCP PACKET FORMAT

DHCP is derived from an earlier protocol called BOOTP, and some of the packet fields are thus not strictly relevant to host configuration. When trying to obtain configuration information, the client puts its hardware address (e.g., its Ethernet address) in the chaddr field. The DHCP server replies by filling in the yiaddr (“your” IP address) field and sending it to the client. Other information such as the default router to be used by this client can be included in the options field.

Internet Protocol (IP)

Simple Internetworking

Internetwork refer to an arbitrary collection of networks interconnected to provide some sort of host to host packet delivery service.

An internetwork is often referred to as a “network of networks” because it is made up of lots of smaller networks. we see Ethernets, an FDDI ring, and a point-to-point link. Each of these is a single-technology network. The nodes that interconnect the networks are called routers. They are also sometimes called gateways, but since this term has several other connotations, we restrict our usage to router.

Internet Protocol

The Internet Protocol is the key tool used today to build scalable, heterogeneous internetworks. It was originally known as the Kahn-Cerf protocol after its inventors. One way to think of IP is that it runs on all the nodes (both hosts and routers) in a collection of networks and defines the infrastructure that allows these nodes and networks to function as a single logical internetwork.

Service Model

The IP service model can be thought of as having two parts: an addressing scheme, which provides a way to identify all hosts in the internetwork, and a datagram (connectionless) model of data delivery. This service model is sometimes called best effort because, although IP makes every effort to deliver datagrams, it makes no guarantees.

Datagram Delivery

The IP datagram is fundamental to the Internet Protocol. A datagram is a type of packet that happens to be sent in a connectionless manner over a network. Every datagram carries enough information to let the network forward the packet to its correct destination;The “best-effort” part means that if something goes wrong and the packet gets lost, corrupted, misdelivered, or in any way fails to reach its intended destination, the network does nothing—it made its best effort, and that is all it has to do. It does not make any attempt to recover from the failure. This is sometimes called an unreliable service.

Best-effort, connectionless service is about the simplest service you could ask for from an internetwork, and this is a great strength. For example, if you provide best effort service over a network that provides a reliable service, then that’s fine—you end up with a best-effort service that just happens to always deliver the packets. If, on the other hand, you had a reliable service model over an unreliable network

Packet Format

Version: Version no. of Internet Protocol used (e.g. IPv4)


Hlen: specifies the length of the header in 32-bit words. When there are no options, which is most of the time, the header is 5 words (20 bytes) long.

TOS: The basic function of TOS is to allow packets to be treated differently based on application needs.


Length: The length includes everything in the datagram – both header and the data, the maximum length is 65,535 bytes.


Identification : The identification field is needed to allow the destination host to determine which datagram a newly arrived fragment belongs to. All the fragments of a datagram contain the same identification value.


Flags: The flags field is of 3-bits, one is unused and two 1-bit fields are DF, MF.

DF means Don’t Fragment , its an order to the router not to fragment the datagram because the receiver is incapable of putting the pieces back to gether again.

MF stands for More Fragments. All fragment except the last one have this bit set. It is needed to know when all fragments of a datagram have arrived.


Offset:The Fragment offset tells where in the current datagram this fragment belongs. All fragments except the last one in a datagram must be a multiple of 8 bytes, the elementary fragment unit. Since 13 bits are provided, there is a maximum of 8192 fragments per datagram, giving a maximum datagram length of 65,536 bytes, one more than the Total length field.


Time to live: The Time to live field is a counter used to limit packet lifetimes. It is supposed to count time in seconds, allowing a maximum lifetime of 255 sec. It must be decremented on each hop and is supposed to be decremented multiple times when queued for a long time in a router. In
practice, it just counts hops. When it hits zero, the packet is discarded and a warning packet is sent back to the source host.
Protocol: When the network layer has assembled a complete datagram, it needs to know what to do with it. The Protocol field tells it which transport process to give it to. TCP is one possibility, but so are UDP and some others.
Checksum: The Header checksum verifies the header only. Such a checksum is useful for detecting errors generated by bad memory words inside a router.

Source address and Destination address: The Source address and Destination address indicate the network number and host number.


Option Description
Security Specifies how secret the datagram is
Strict source routing Gives the complete path to be followed
Loose source routing Gives a list of router not to be missed
Record route Makes each router append its IP address
Timestamp Makes each router append its address and timestamp


IP Addresses

Every host and router on the Internet has an IP address, which encodes its network number and host number. The combination is unique: in principle, no two machines on the Internet have the same IP address. All IP addresses are 32 bits long and are used in the Source address and Destination address fields of IP packets. It is important to note that an IP address does not actually refer to a host. It really refers to a network interface, so if a host is on two networks, it must have two IP addresses. However, in practice, most hosts are on one network and thus have one IP address.

IP addresses were divided into the five categories.This allocation has come to be called classful addressing.



The class A, B, C, and D formats allow for up to 128 networks with 16 million hosts each, 16,384 networks with up to 64K hosts, and 2 million networks (e.g., LANs) with up to 256 hosts each (although a few of these are special). Also supported is multicast, in which a datagram is directed to multiple hosts. Addresses beginning with 1111 are reserved for future use. Over 500,000 networks are now connected to the Internet, and the number grows every year. Network numbers are managed by a nonprofit corporation called ICANN (Internet Corporation for Assigned Names and Numbers) to avoid conflicts.

Datagram Forwarding in IP

IP routers forward datagrams in an internetwork. That forwarding is the process of taking a packet from an input and sending it out on the appropriate output, while routing is the process of building up the tables that allow the correct output for a packet to be determined.

The main points to bear in mind as we discuss the forwarding of IP datagrams are the following:

  • Every IP datagram contains the IP address of the destination host. 
  • The “network part” of an IP address uniquely identifies a single physical network that is part of the larger Internet.
  • All hosts and routers that share the same network part of their address are connected to the same physical network and can thus communicate with each other by sending frames over that network.
  • Every physical network that is part of the Internet has at least one router that,by definition, is also connected to at least one other physical network; this router can exchange packets with hosts or routers on either network.

Forwarding Strategy: 

  • every datagram contains destination's address
  • if directly connected to destination network, then forward to host
  • if not directly connected to destination network, then forward to some router
  • forwarding table maps network number into next hop
  • each host has a default router
  • each router maintains a forwarding table
Datagram forwarding algorithm

if (NetworkNum of destination = NetworkNum of one of my interfaces) then
deliver packet to destination over that interface
else
if (NetworkNum of destination is in my forwarding table) then
deliver packet to NextHop router
else
deliver packet to default router

For a host with only one interface and only a default router in its forwarding table, this simplifies to

if (NetworkNum of destination = my NetworkNum) then
deliver packet to destination directly
else
deliver packet to default router