Tuesday, September 13, 2011

Networking cables

Networking Cables are used to connect one network device to other or to connect two or more computers to share printer, scanner etc. Different types of network cables like Coaxial cable, Optical fiber cable, Twisted Pair cables are used depending on the network's topology, protocol and size. The devices can be separated by a few meters (e.g. via Ethernet) or nearly unlimited distances (e.g. via the interconnections of the Internet).

While wireless may be the wave of the future, most computer networks today still utilize cables to transfer signals from one point to another
Twisted pair
Main article: Twisted pair

Twisted pair cabling is a form of wiring in which two conductors (the forward and return conductors of a single circuit) are twisted together for the purposes of canceling out electromagnetic interference (EMI) from external sources; for instance, electromagnetic radiationTwisted pair are classified into two types unshielded twisted pair shielded twisted pair from unshielded twisted pair (UTP) cables, and crosstalk between neighboring pairs.This type of cable is used for home and corporate networks utilising the RJ45 connector ends
 Optical fiber cable
Main article: Optical fiber cable

An optical fiber cable is a cable containing one or more optical fibers. The optical fiber elements are typically individually coated with plastic layers and contained in a protective tube suitable for the environment where the cable will be deployed. Coaxial cable
Main article: coaxial cable

Coaxial lines confine the electromagnetic wave to the area inside the cable, between the center conductor and the shield. The transmission of energy in the line occurs totally through the dielectric inside the cable between the conductors. Coaxial lines can therefore be bent and twisted (subject to limits) without negative effects, and they can be strapped to conductive supports without inducing unwanted currents in them.

The most common use for coaxial cables is for television and other signals with bandwidth of multiple megahertz. Although in most homes coaxial cables have been installed for transmission of TV signals, new technologies (such as the ITU-T G.hn standard) open the possibility of using home coaxial cable for high-speed home networking applications (Ethernet over coax).

In the 20th century they carried long distance telephone connections.
 Patch cable


A patch cable is an electrical or optical cable, used to connect one electronic or optical device to another for signal routing. Devices of different types (ie: a switch connected to a computer, or switch to router) are connected with patch cords, and it works. It is a very fast connection speed. Patch cords are usually produced in many different colors so as to be easily distinguishable,[2] and are relatively short, perhaps no longer than two metres. Ethernet crossover cable
Main article: Ethernet crossover cable

An Ethernet crossover cable is a type of Ethernet cable used to connect computing devices together directly where they would normally be connected via a network switch, hub or router, such as directly connecting two personal computers via their network adapters.
 Power lines

Although power wires are not designed for networking applications, new technologies like Power line communication allows these wires to also be used to interconnect home computers, peripherals or other networked consumer products. On December 2008, the ITU-T adopted Recommendation G.hn/G.9960 as the first worldwide standard for high-speed powerline communications.[3] G.hn also specifies communications over phonelines and coaxial wiring.

List of computers networking device

Common basic networking devices:

    * Router: a specialized network device that determines the next network point to which it can forward a data packet towards the destination of the packet. Unlike a gateway, it cannot interface different protocols. Works on OSI layer 3.
    * Bridge: a device that connects multiple network segments along the data link layer. Works on OSI layer 2.
    * Switch: a device that allocates traffic from one network segment to certain lines (intended destination(s)) which connect the segment to another network segment. So unlike a hub a switch splits the network traffic and sends it to different destinations rather than to all systems on the network. Works on OSI layer 2.
    * Hub: connects multiple Ethernet segments together making them act as a single segment. When using a hub, every attached all the objects, compared to switches, which provide a dedicated connection between individual nodes. Works on OSI layer 1.
    * Repeater: device to amplify or regenerate digital signals received while sending them from one part of a network into another. Works on OSI layer 1.

Some hybrid network devices:

    * Multilayer Switch: a switch which, in addition to switching on OSI layer 2, provides functionality at higher protocol layers.
    * Protocol Converter: a hardware device that converts between two different types of transmissions, such as asynchronous and synchronous transmissions.
    * Bridge Router (B router): CombineS router and bridge functionality and are therefore working on OSI layers 2 and 3.

Hardware or software components that typically sit on the connection point of different networks, e.g. between an internal network and an external network:

    * Proxy: computer network service which allows clients to make indirect network connections to other network services
    * Firewall: a piece of hardware or software put on the network to prevent some communications forbidden by the network policy
    * Network Address Translator: network service provide as hardware or software that converts internal to external network addresses and vice versa

Other hardware for establishing networks or dial-up connections:

    * Multiplexer: device that combines several electrical signals into a single signal
    * Network Card: a piece of computer hardware to allow the attached computer to communicate by network
    * Modem: device that modulates an analog "carrier" signal (such as sound), to encode digital information, and that also demodulates such a carrier signal to decode the transmitted information, as a computer communicating with another computer over the telephone network
    * ISDN terminal adapter (TA): a specialized gateway for ISDN
    * Line Driver: a device to increase transmission distance by amplifying the signal. Base-band networks onl

Sunday, September 11, 2011

computers names and ip addresses

So every interface on every node has an IP address. It was realized quite quickly that humans are pretty bad at remembering numbers, so it was decided (just like phone numbers) to have a directory of names. But since we're using computers anyway, it's nicer to have the computer look up the names for us automatically.

Hence we have the Domain Name System (DNS). There are nodes with well known IP addresses which programs can ask to look up names, and return IP addresses. Almost all programs you will use are capable of doing this, which is why you can put `www.linuxcare.com' into Netscape, instead of `167.216.245.249'.

Of course, you need the IP address of at least one of these `name servers': usually these are kept in the `/etc/resolv.conf' file.

Since DNS queries and responses are fairly small (1 packet each), the TCP protocol is not usually used: it provides automatic retransmission, ordering and general reliability, but at a cost of sending extra packets through the network. Instead we use the very simple `User Datagram Protocol', which doesn't offer any of the fancy TCP features we don't need.

Network Masks

There is one last detail: there is a standard notation for groups of IP addresses, sometimes called a `network address'. Just like a phone number can be broken up into an area prefix and the rest, we can divide an IP address into a network prefix and the rest.
It used to be that people would talk about `the 1.2.3 network', meaning all 256 addresses from 1.2.3.0 to 1.2.3.255. Or if that wasn't a big enough network, they might talk about the `1.2 network' which meant all addresses from 1.2.0.0 to 1.2.255.255.

We usually don't write `1.2.0.0 - 1.2.255.255'. Instead, we shorten it to `1.2.0.0/16'. This weird `/16' notation (it's called a `netmask') requires a little explanation.
Each number between the dots in an IP address is actually 8 binary digits (00000000 to 11111111): we write them in decimal form to make it more readable for humans. The `/16' means that the first 16 binary digits is the network address, in other words, the `1.2.' part is the the network (remember: each digit represents 8 binary digits). This means any IP address beginning with `1.2.' is part of the network: `1.2.3.4' and `1.2.3.50' are, and `1.3.1.1' is not.
To make life easier, we usually use networks ending in `/8', `/16' and `/24'. For example, `10.0.0.0/8' is a big network containing any address from 10.0.0.0 to 10.255.255.255 (over 16 million addresses!). 10.0.0.0/16 is smaller, containing only IP addresses from 10.0.0.0 to 10.0.255.255. 10.0.0.0/24 is smaller still, containing addresses 10.0.0.0 to 10.0.0.255.
To make things confusing, there is another way of writing netmasks. We can write them like IP addresses:

10.0.0.0/255.0.0.0

Finally, it's worth noting that the very highest IP address in any network is reserved as the `broadcast address', which can be used to send a message to everyone on the network at once.
Here is a table of network masks:
Short   Full                    Maximum         Comment
  Form    Form                    #Machines

/8      /255.0.0.0              16,777,215      Used to be called an `A-class'
/16     /255.255.0.0            65,535          Used to be called an `B-class'
/17     /255.255.128.0          32,767
/18     /255.255.192.0          16,383
/19     /255.255.224.0          8,191
/20     /255.255.240.0          4,095
/21     /255.255.248.0          2,047
/22     /255.255.252.0          1,023
/23     /255.255.254.0          511
/24     /255.255.255.0          255             Used to be called a `C-class'
/25     /255.255.255.128        127
/26     /255.255.255.192        63
/27     /255.255.255.224        31
/28     /255.255.255.240        15
/29     /255.255.255.248        7
/30     /255.255.255.252        3

IP Things

So the role of the IP layer is to figure out how to `route' packets to their final destination. To make this possible, every interface on the network needs an `IP address'. An IP address consists of four numbers separated by periods, like `167.216.245.249'. Each number is between zero and 255.
Interfaces in the same network tend to have neighboring IP addresses. For example, `167.216.245.250' sits right next to the machine with the IP address `167.216.245.249'. Remember also that a router is a node with interfaces on more than one network, so the router will have one IP address for each interface.

So the Linux Kernel's IP layer keeps a table of different `routes', describing how to get to various groups of IP addresses. The simplest of these is called a `default route': if the IP layer doesn't know better, this is where it will send a packet onwards to. You can see a list of routes using `/sbin/route'.
Routes can either point to a link, or a particular node which is connected to another network. For example, when you dial up to the ISP, your default route will point to the modem link, because that's where the entire world is.

  Rusty's              ISP's  ~~~~~~~~~~~~ 
   Modem               Modem {            }
       o------------------o { The Internet }
                             {            }
                              ~~~~~~~~~~~~  
But if you have a permanent machine on your network which connects to the outside world, it's a bit more complicated. In the diagram below, my machine can talk directly to Tridge and Paul's machines, and to the firewall, but it needs to know that packets heading the rest of the world need to go to the firewall, which will pass them on. This means that you have two routes: one which says `if it's on my network, just send it straight there' and then a default route which says `otherwise, send it to the firewall'.

                         o  Tridge's
                         |    Work Machine      ~~~~~~~~~~~~
  Rusty's                |                     {            } 
   Work Machine o--------+-----------------o--{ The Internet }
                         |            Firewall {            } 
                         |                      ~~~~~~~~~~~~
                         o  Paul's
                              Work Machine

Interenet working

The question then arises: how come every node on the Internet can talk to the others, if they all use different link-level protocols to talk to each other?

The answer is fairly simple: we need another protocol which controls how stuff flows through the network. The link-level protocol describes how to get from one node to another if they're connected directly: the `network protocol' tells us how to get from one point in the network to any other, going through other links if necessary.

For the Internet, the network protocol is the Internet Protocol (version 4), or `IP'. It's not the only protocol out there (Apple's AppleTalk, Novell's IPX, Digital's DECNet and Microsoft's NetBEUI being others) but it's the most widely adopted. There's a newer version of IP called IPv6, but it's still not common.

So to send a message from one side of the globe to another, your computer writes a bit of Internet Protocol, sends it to your modem, which uses some modem link-level protocol to send it to the modem it's dialed up to, which is probably plugged into a terminal server (basically a big box of modems), which sends it to a node inside the ISP's network, which sends it out usually to a bigger node, which sends it to the next node... and so on. A node which connects two or more networks is called a `router': it will have one interface for each network.

We call this array of protocols a `protocol stack', usually drawn like so:

 [ Application: Handles Porn ]           [ Application Layer: Serves Porn ]
              |                                          ^
              v                                          |
[ TCP: Handles Retransmission ]          [ TCP: Handles Retransmission ]
              |                                          ^
              v                                          |
    [ IP: Handles Routing ]                   [ IP: Handles Routing ]
              |                                          ^
              v                                          |
[ Link: Handles A Single Hop ]           [ Link: Handles A Single Hop ]
              |                                          |
              +------------------------------------------+
So in the diagram, we see Netscape (the Application on top left) retrieving a web page from a web server (the Application on top right). To do this it will use `Transmission Control Protocol' or `TCP': over 90% of the Internet traffic today is TCP, as it is used for Web and EMail.
So Netscape makes the request for a TCP connection to the remote web server: this is handed to the TCP layer, which hands it to the IP layer, which figures out which direction it has to go in, hands it onto the appropriate link layer, which transmits it to the other end of the link.
At the other end, the link layer hands it up to the IP layer, which sees it is destined for this host (if not, it might hand it down to a different link layer to go out to the next node), hands it up to the TCP layer, which hands it to the server.
So we have the following breakdown:

  1. The application (Netscape, or the web server at the other end) decides who it wants to talk to, and what it wants to send).
  2. The TCP layer sends special packets to start the conversation with the other end, and then packs the data into a TCP `packet': a packet is just a term for a chunk of data which passes through a network. The TCP layer hands this packet to the IP layer: it then keeps sending it to the IP layer until the TCP layer at the other end replies to say that it has received it. This is called `retransmission', and has a whole heap of complex rules which control when to retransmit, how long to wait, etc. It also gives each packet a set of numbers, which mean that the other end can sort them into the right order.
  3. The IP layer looks at the destination of the packet, and figures out the next node to send the packet to. This simple act is called `routing', and ranges from really simple (if you only have one modem, and no other network interfaces, all packets should go out that interface) to extremely complex (if you have 15 major networks connected directly to you).

Interenet

The Internet is a WAN which spans the entire globe: it is the largest computer network in existence. The phrase `internetworking' refers to connecting separate networks to build a larger one, hence `The Internet' is the connection of a whole pile of subnetworks.
So now we look at the list above and ask ourselves: what is the Internet's size, physical details and protocols?
The size is already established above: it's global.
The physical details are varied however: each little sub-network is connected differently, with a different layout and physical nature. Attempts to map it in a useful way have generally met with abject failure.
The protocols spoken by each link are also often different: all of the link-level protocols listed above are used, and many more.