Learning Python Network Programming

(Sean Pound) #1
Chapter 1

Networks


A network is a discrete collection of connected network devices. Networks
can vary greatly in scale, and they can be made up of smaller networks. Your
network-connected devices at home or the network-connected computers in a
large office building are examples of networks.


There are quite a few ways of defining a network, some loose, some very
specific. Depending on the context, networks can be defined by physical
boundaries, administrative boundaries, institutional boundaries, or network
technology boundaries.


For this section, we're going to start with a simplified definition of a network,
and then work toward a more specific definition, in the form of IP subnets.


So for our simplified definition, our common defining feature of a network will be
that all devices on the network share a single point of connection to the rest of the
Internet. In some large or specialized networks, you will find that there is more
than one point of connection, but for the sake of simplicity we'll stick to a single
connection here.


This connection point is called a gateway, and usually it takes the form of a special
network device called a router. The job of a router is to direct traffic between
networks. It sits between two or more networks and is said to sit at the boundary of
these networks. It always has two or more network interfaces; one for each network
it is attached to. A router contains a set of rules called a routing table, which tells it
how to direct the packets that are passing through it onwards, based on the packets'
destination IP addresses.


The gateway forwards the packets to another router, which is said to be upstream,
and is usually located at the network's Internet Service Provider (ISP). The ISP's
router falls into a second category of routers, that is, it sits outside the networks
described earlier, and routes traffic between network gateways. These routers are
run by ISPs and other communications entities. They are generally arranged in tiers,
and the upper regional tiers route the traffic for some large sections of countries or
continents and form the Internet's backbone.

Free download pdf