Tcp ip networking tutorial pdf




















Almost all decimal subnet masks convert to binary numbers that are all ones on the left and all zeros on the right. Some other common subnet masks are:. These IP addresses are divided into classes. The most common of these are classes A, B, and C. Classes D and E exist, but are not generally used by end users.

Each of the address classes has a different default subnet mask. You can identify the class of an IP address by looking at its first octet. In some scenarios, the default subnet mask values do not fit the needs of the organization, because of the physical topology of the network, or because the numbers of networks or hosts do not fit within the default subnet mask restrictions.

The next section explains how networks can be divided using subnet masks. This becomes necessary as you reconcile the logical address scheme of the Internet the abstract world of IP addresses and subnets with the physical networks in use by the real world. A system administrator who is allocated a block of IP addresses may be administering networks that are not organized in a way that easily fits these addresses. Each of these three networks has 50 hosts.

You are allocated the class C network For illustration, this address is actually from a range that is not allocated on the Internet. This means that you can use the addresses Two addresses that cannot be used in your example are The zero address is invalid because it is used to specify a network without specifying a host. The address in binary notation, a host address of all ones is used to broadcast a message to every host on a network.

Just remember that the first and last address in any network or subnet cannot be assigned to any individual host. You should now be able to give IP addresses to hosts. This works fine if all computers are on a single network. However, your computers are on three separate physical networks. Instead of requesting more address blocks for each network, you divide your network into subnets that enable you to use one block of addresses on multiple physical networks.

In this case, you divide your network into four subnets by using a subnet mask that makes the network address larger and the possible range of host addresses smaller. The subnet mask This works because in binary notation, The first two digits of the last octet become network addresses, so you get the additional networks 0 , 64 , and Some administrators will only use two of the subnetworks using For more information on this topic, see RFC In these four networks, the last 6 binary digits can be used for host addresses.

Using a subnet mask of These four networks would have as valid host addresses:. Remember, again, that binary host addresses with all ones or all zeros are invalid, so you cannot use addresses with the last octet of 0, 63, 64, , , , , or One of the problems with the current addressing is that the addresses are given away in large chunks.

Subnetting allows these large chunks of addresses to be further split into a further network and host component. This new network component is called the subnet.

The following shows how a class B network address could effectively split into separate virtual class C networks:. The network portion has been fixed so still stands as the first two octets. The next octet which would normally be part of the host address is then made to signify the subnet and effectively becomes part of the network address.

The final octet is left as the host portion of the address. If we change which part of the address represents the network and host then we need to tell the computer and any routing devices of that.

The technique used is known as creating a subnet mask. The subnet mask for the above example would be To explain how this is derived requires a little bit of binary arithmetic. I will attempt to briefly explain how this works, however am unable to devote a large section to it. Whilst an IP address is generally represented as decimal numbers to make it easier for people to understand, however the computer works on binary numbers which can only represent one or zero.

For example the following address shown as dotted decimal and binary. To create a subnet mask we need to use a binary one for every bit of the address that represents the network portion and a binary zero for any bit of the address that represents the host portion.

This gives us:. It would use a binary AND to get the network portion. Just to confuse matters further some equipment e. Cisco routers use a different notation to represent the subnet mask.

The would count in the number of '1' bits and give that as the subnet mask number. This is referred to as the CIDR notation. The example above showed the subnet mask on a octet boundary however it is more common to see a subnet mask within an octet. For example the subnet mask The subtends are given a number which is when all the host portion are zero. All the rest of the addresses are valid until the part where all the host bits are ones which is the broadcast address for that subnet.

Looking at only the last octet the following table shows how some of the address will be made up. Subnet Number First Address 2nd address Last address Broadcast 8 9 To try and understand this better convert the values in binary and then identify the host and network portions of the address.

Whilst I have excluded the 0 address it is sometimes possible to actually use this. For this you may have to ensure that your routers support this and that the feature is turned on. It is however not recommended. A alternative subnet mask could be You may find it a useful exercise to try and calculate these values for yourself.

The opposite of subnetting is called supernetting. The class A and B network ranges have been all but used up and so instead several class C networks are grouped together for larger organisations and ISP's. Whilst the IP address provides the connection to the correct machine, it cannot distinguish the different service that is required.

The port is used to distinguish the application. It is a value from 0 to The combination of IP address, port and protocol is called a socket, and has to be unique for every service. These are referred to as well known ports. There are other addressing protocols used. These are at lower levels of the protocol stack and differ depending upon the media being used. The following diagram is used to show how this works. Down at the lower levels the physical ethernet connection does not know anything about IP addressing.

The IP addressing occurs at layer 3 which is higher than Layers 1 and 2 that ethernet works at. Instead they use a MAC address which consists of 6 numbers separated by colons. The MAC address is usually hard coded into the ethernet card and are unique across every device made. This is achieved by allocating a block of addresses to each manufacturer of ethernet devices. Normally the user would not know or care about the value of the MAC address as it is transparent to the user.

It is sometimes possible to manually change the MAC address, but this is not advisable unless you have a specific requirement and know what you are doing. For example when system Sys1 wants to communicate with another such as Sys4 then the user would use its IP address If the machine is not located on the same LAN then this requires IP routing which is explained later.

Whilst the IP addressing scheme allows computers to communicate with each other it's not particularly an easy way for people to remember. Which would you find easier to remember www. Hostnames have an hierarchical structure. The names read from right to left as though moving down a tree.

Figure 5: Example DNS tree. The final name of this computer known as the fully qualified domain name FQDN is mail. The responsibility of dividing up all the names below the company name is owned by the end company or organisation. However the organisation domains obviously need to be allocated by a governing body to ensure that two companies don't try and use the same one. This is administered by local organisations dependant upon the top level domain.

The primary TLDNs are :. There are also country top level domains that can be used for domains within countries, although note that there is no restriction on being located or working in that country. For example the top level domain for the United Kingdom is uk.

Some examples are:. If a computer wants to communicate with www. Their local DNS server does not know about the existence of the web site. This DNS does not know anything about the computer in question however it does now about the. When the local DNS server then contacts that server is does have the entries for that domain and can provide the specific ip address. Another way is for one of the intermediate DNS servers to provide a recursive query, whereby it goes and queries another DNS server on behalf of the requesting DNS server.

DNS servers do not have to support recursive queries, in which case the initial DNS server will need to perform the lookups itself.

This sounds like a very long process if it has to be carried out for every machine that is to be accessed. If this was the case then the load on the top level DNS servers would be excessive. To speed up the DNS process many DNS machines provide a caching feature where they can store the result of some of the lookups they perform. The names cached can either be for specific hosts although except for popular sites they will be less likely to have a hit on the cache.

The use of a DNS cache is so significant that there are even caching-only DNS servers that do not act as a zone of authority for any domain. If a Domain Name Server is unavailable then it would not be possible to access other machines. Therefore a backup server is configured as a fallback these are called secondary name servers as they can respond to the queries, but do not own the actual entries. The primary name server will push its configuration for any secondary name servers that it has configured as slaves.

If you don't have access to a DNS server, or would like to have additional entries not stored on a DNS server then these can be configured directly on the local computer. The host file is a list of hostnames and their IP addresses which allows them to be directly mapped. This can work for a small organisation or local network but if you had more than a handful of machines it is better to use a local DNS server.

If two machines are connected together as a point-to-point connection over a physical connection then they can communicate between each other directly. However once we start to communicate to computers on other networks, or over the Internet then routing is needed so that the data reaches the correct destination. The devices that handle the directing of traffic are known as routers. These routers take an incoming packet and based upon the destination address send them through a different interface to either another router or to the end destination.

For a normal host computer all that is needed to handle the routing of all packets is to define the default gateway. The default gateway is a router directly attached to the same LAN segment as the host that knows how to route the packets on. Then for any address that is not locally held then it forwards the packet to the local router asking it to forward on to its destination.

Alternatively for different networks the system could have multiple routes defined for different networks or hosts, or could participate in a dynamic routing protocol. The router will then forward the packet on directly to the host network or to another router. Whenever a packet passes through a router this is called a hop. There are three different types of routes. They could be implicit, static or dynamic. Static are individually defined often this will include a default route and dynamic is where a networking protocol is used to identify the most appropriate route for different connections.

For static routes each entry in the routing table is added by using the route command. This is normally used to connect a host to its networks, but can be used for routers typically in smaller easy to manage networks.

It is possible that when a packet is sent using static routes that it will not neccessarily go the most direct route. For example if there are two routers on the LAN one of which goes directly to the host but the other would have to pass it to the other. This is illustrated below. Here we have Sys1 which is on network 0.

There are two routers on the same LAN segment but Sys1 only has a default route pointing at Router 1. When Sys1 wants to communicate with Sys21 it first sends its request to Router1. Router1 realises that it has to forward it on to Router2 and that it would have been easier for Sys1 to have sent it directly there.

Sys1 then adds a route in its routing table to send any packets for Sys21 to Router2. Then when Sys1 next needs to send a packet to Sys21 it can send it directly to Router2. The operating system can handle these ICMP redirects or it can ignore them, depending upon the settings. There are three dynamic routing protocols in general use. These work by routers constantly communicating to each other describing the network to each other.

RIP uses the hop count i. OSPF is more sophisticated and allows the network administrator to set metrics to indicate a cost in using a certain route. This allows more expensive links e. These are all interior protocols as they are used within a network.

RIP is a simple protocol based on distance vectors. It uses a shortest path algorithm to determine the best route to the destination. This is measured in hops which is normally then number of gateways routers that are passed through before reaching a destination network.

The routing daemon dynamically learns about the network using the RIP protocol and builds its own routing tables. The line speed, reliability or cost are not taken into account when looking at the shortest link. There is a maximum hop count of 15 using RIP.

Any destination over 15 hops away is considered to be an infinite number away and cannot be reached. This is a required feature of the RIP protocol as otherwise it would be possible to get routing loops where the routers through having out of date routes or static routes pass the packet around in a continuous circle.

Whilst suitable for small to medium networks this does not transfer well to a large network, due to its inflexibility and its low hop count. The updates between routers are sent using UDP on port When a router joins the network it broadcasts requesting for other routers to send their routing tables. Thereafter the router will advertise its tables to its neighbours every 30 seconds. Also if there is an update indicating a change in the network a router will send it immediately almost.

This is documented in RFC The new features include:. Authentication - only accepts updates when provided with the correct password Route Tag - Allows a tag value to be added to indicate that a link is external Subnet Mask - Allows RIP to work in variably subnetted networks Next Hop - Max RIP more flexible when used in a network with multiple routing protocols i.

For RIP 2 then the gated daemon is stated with an empty configuration file. The network map is a database help by each node and updates and performed by "flooding". All map updates must be secured. In link state protocols each router is responsible for determining the identity of its neighbours. The router constructs a link state package LSP which lists its neighbours and the cost of the link. This is transmitted to all routers which then store the most recent LSP received from each router.

The routers then construct a link state packet database from which the routes through the network are calculated.



0コメント

  • 1000 / 1000