Network Services

Hotspot Mikrotik 777

Technology has been used Bootstrap Compatible Mobile.

Design Hotspot-12 beautiful Server Mikrotik

Design Hot Spot Mikrotik Free

Hotspot login server free

Hotspot login server free.

Merge 2 lines in server Pfsense?

Merge 2 lines in server Pfsense server free.

setup squid cahce in Ubuntu

How to setup squid cahce in Ubuntu ?

Tuesday, December 3, 2013

Configuring TCP/IP on Windows Workstations


Configuring TCP/IP on Windows Workstations

Being able to configure your operating system to use TCP/IP is a must for any network administrator.
Because Microsoft Windows is the dominant operating system, we will show you how to configure a Windows client to use TCP/IP. The information in this section assumes that you already have Windows 2000 running on the client.
Because you are likely using Plug and Play network interface cards, Microsoft Windows 2000 automatically installs TCP/IP on your machine. In this case, you can skip ahead to the discussion
in Chapter 4 on how to use the TCP/IP utilities to confirm that your system is up and running properly.
       If, however, you want to look at or change some of the configuration settings or if TCP/IP

doesn’t seem to be installed on your system for whatever reason, stay with this chapter.

Note:
There is very little difference between configuring TCP/IP on a Windows 2000
device regardless of the exact version or function, such as Server or Professional.
The dialog boxes you use are virtually identical. Windows 2000 Professional
is used in the discussion that follows. Windows XP and 2003 are slightly
different in appearance, but still very similar.
 To begin configuring TCP/IP, follow these steps:

  1. Choose Start Settings Control Panel Network and Dial-Up Connections to open the Network and Dial-Up Connections dialog box, which lists all of the currently installed network components.
  2. Right-click one of your network adapters and select Properties to open the Properties dialog box for your adapter.
  3. If you do not see Internet Protocol (TCP/IP) in the scrolling list (assuming you have enough entries to scroll), follow the next three steps. If you do see it, skip to step 7.
4.  Click the Install button, which brings up the Select Network Component Type window.

5. Click Protocol in the list and click the Add button to bring up the Select Network Protocol dialog box.

6.  Select Microsoft from the left frame and Internet Protocol (TCP/IP) from the right frame and click the OK button. This will take you back to the Properties dialog box for your adapter. Now Internet Protocol (TCP/IP) should appear in the scrolling list.

7.  Click Internet Protocol (TCP/IP) and click the Properties button, which brings up the Internet Protocol (TCP/IP) Properties window.


8. Initially, you see the General tab, which is set to obtain your IP address, subnet mask, default gateway, and DNS server(s) via DHCP. You may select the alternate radio buttons to manually enter this information.
9. Click the Advanced button, which brings up the Advanced TCP/IP Settings dialog box.
10. Notice the IP Settings, DNS, WINS, and Options tabs along the top of the Advanced TCP/IP Settings dialog box (shown in Figure 3.7 in the next section).

In the following sections, we will look at these four tabs. In addition, we will cover key information regarding the configuration database of Windows, known as the Registry, and the open
set of protocols, known as ZeroConf, designed to reduce the amount of manual TCP/IP configuration necessary to bring up a small network.

Using WINS


Using WINS

WINS, or Windows Internet Naming Service, is an essential part of the Microsoft networking topology as long as NetBIOS is still in use. But before we get into the discussion of WINS, we must define a few terms, including these two protocols—NetBIOS and NetBEUI. 
NetBIOS NetBIOS (pronounced “net-bye-ose”) is an acronym formed from network basic input/output system, a Session layer network protocol originally developed by IBM and Sytek to manage data exchange and network access. NetBIOS provides an application programming interface (API) with a consistent set of commands for requesting lower-level network services to transmit information from node to node, thus separating the applications from the underlying network operating system. Many vendors once provided either their own version of NetBIOS or an emulation of its communications services in their products.

NetBEUI NetBEUI (pronounced “net-boo-ee”) is an acronym formed from NetBIOS Extended User Interface, an implementation and extension of IBM’s NetBIOS transport protocol from Microsoft. NetBEUI communicates with the network through Microsoft’s Network Driver Interface Specification (NDIS). NetBEUI was once shipped with all versions of Microsoft’s operating systems and is generally considered to have a lot of overhead. It also has no structure to its addressing format, which does not allow determination of a network and therefore means it has no routing capability, making it suitable only for small networks; you cannot build internetworks with NetBEUI, and so it is often replaced with TCP/IP. Microsoft added extensions to NetBEUI in Windows NT to remove the limitation of 254 sessions per node. This extended version of Net- BEUI is called the NetBIOS Frame (NBF).


      WINS is used in conjunction with TCP/IP and maps NetBIOS names to IP addresses. For example, you have a print server on your LAN that you have come to know as PrintServer1. In the past, to print to that server you needed only to remember its name and to select that name from a list. However, TCP/IP is a completely different protocol and doesn’t understand Net- BIOS names; it therefore has no way of knowing the location of those servers. That’s where WINS comes in.
      Each time you access a network resource on a Windows network using TCP/IP, your system needs to know the host name or IP address. If there are no routers in your network, NetBIOS speaking devices can simply broadcast their presence on the network and broadcast a request for the unknown MAC address of a known NetBIOS name, all without a WINS server. Once routers are introduced, however, the broadcasts that NetBIOS uses for resolution do not make it through the routers, so connectivity is lost to devices not on the same subnet as the requesting device. If WINS is installed in a routed environment, you can continue using the NetBIOS names that you have previously used to access the resources because WINS provides the cross-reference from NetBIOS name to IP address for you. Once the IP address is known, ARP can be used to obtain the MAC address after the packet has been routed to the proper IP subnet.

Note:
A NetBIOS name doesn’t always refer to just a machine. Several services on a machine can also have their own NetBIOS names.

When you install and configure TCP/IP, as described later in this chapter, you’ll see a place to specify the WINS server addresses. These addresses are stored with the configuration, and
TCP/IP uses them to query for host names and addresses when necessary. WINS is similar toDNS in that it cross-references host names to addresses; however, as mentioned earlier, WINS
resolves NetBIOS names to IP addresses, but DNS resolves TCP/IP FQDNs to IP addresses.
      Another major difference between WINS and DNS is that WINS builds its own reference tables dynamically but you have to configure DNS manually. Dynamic DNS (DDNS) does exist,

but it is not yet implemented on the Internet. When a workstation running TCP/IP is booted and attached to the network, it uses the WINS address settings in the TCP/IP configuration to communicate
with the WINS server. The workstation gives the WINS server various pieces of information about itself, such as the NetBIOS host name, the actual username logged on to the workstation, and the workstation’s IP address. WINS stores this information for use on the network and periodically refreshes it to maintain accuracy.
       Microsoft, however, has developed a new DNS record—called DNS Server—that allows the DNS server to work in perfect harmony with a WINS server. The Microsoft DNS Server software
was shipped with Windows NT and later server systems. Here’s how it works: The host name portion of the DNS FQDN can be looked up on the WINS server for hosts in the local domain. Thus, you need not build complex DNS tables to establish and configure name resolution on your server; Microsoft DNS relies entirely on WINS to tell it the addresses it needs to resolve. And because WINS builds its tables automatically, you don’t have to edit the DNS tables when addresses change; WINS takes care of this for you. This feature also is not available on the Internet.
      You can use both WINS and DNS on your network, or you can use one without the other. Your choice is determined by whether your network is connected to the Internet and whether your host addresses are dynamically assigned. When you are connected to the Internet, you must use DNS to resolve host names and addresses because TCP/IP depends on DNS service for address resolution. Addresses of both DNS and WINS servers can be supplied to a host with its Dynamic Host Configuration Protocol (DHCP) lease.

Using DHCP
The primary reason for using DHCP is to centralize the management of IP addresses. When the DHCP service is used, DHCP scopes include pools of IP addresses that are assigned for automatic distribution to client computers on an as-needed basis, in the form of leases, which are periods of time for which the DHCP client may keep the configuration assignment. Clients attempt to renew their lease at 50 percent of the lease duration. The address pools are centralized on the DHCP server, allowing all IP addresses on your network to be administered from a single server. It should be apparent that this saves loads of time when changing the IP
addresses on your network. Instead of running around to every workstation and server and resetting the IP address to a new address, you simply reset the IP address pool on the DHCP
server. The next time the client machines are rebooted, they are assigned new addresses.

    If the client workstation cannot locate the DHCP server on the network automatically, either you will see an error message to that effect when you restart the client workstation or Automatic Private IP Addressing (APIPA) running on the machine will assign itself an IP address in the 169.254.0.0/16 address range.

    More capable than RARP, DHCP is an update to the Bootstrap Protocol (BootP) and can manage much more than the IP addresses of client computers. It can also assign DNS servers, WINS servers, default gateway addresses, subnet masks, and many other options.


Using DNS


Using DNS

The abbreviation DNS stands for Domain Name Service. You use DNS to translate host names and domain names to IP addresses, and vice versa, by means of a standardized lookup table that
the network administrator defines and configures. The system works just like a giant telephone directory.
Suppose you are using your browser to surf the Web and you enter the URL http:// www.microsoft.com to go to the Microsoft home page. Your web browser then asks the TCP/IP protocol to ask the DNS server for the IP address of www.microsoft.com. When your web browser receives this address, it connects to the Microsoft web server and downloads the home page. DNS is an essential part of any TCP/IP network because it simplifies the task of remembering
addresses; all you have to do is simply remember the host name and domain name. A DNS zone is an administrative area or name space within a DNS domain. For example, sybex.com is a DNS domain, but there is a server that is authoritative over the sybex.com

name space, or zone. An additional level could be added to sybex.com, making, for instance, networkbooks.sybex.com. The networkbooks zone would be handled by a particular server.
The server holds the zone file, or DNS table, for that zone. DNS tables are composed of records. Most records are composed of a host name, a record type, and an IP address. There are several
record types, including the address record, the mail exchange record, the CNAME record, and the SOA record.
      There are primary DNS servers, which are authoritative for the zone for which they carry the zone file, and secondary DNS servers, which have a nonauthoritative copy of the zone file updated from the primary server. The DNS zone file must be changed only on the primary server that is authoritative for that zone. If changes are made to the secondary server, the changes will not be propagated elsewhere, and these changes will be lost during the next update from the primary server. What this means is that whenever a change to any record is required, even one as simple as adding the IP address of a new server or changing the IP address of an established one, the change must be performed by the administrator, ISP, or other entity that hosts and has write access to the primary DNS server that is authoritative for the domain/zone in which the change occurs.
        The address record, commonly known as the A record, maps a host name to an IP address. The following example shows the address record for a host called mail in the company.com domain:

mail.company.com.            IN              A              204.176.47.9

The mail exchange (MX) record points to the mail exchanger for a particular host. DNS is structured so that you can actually specify several mail exchangers for one host. This feature provides a higher probability that e-mail will actually arrive at its intended destination. The mail exchangers are listed in order in the record, with a priority code that indicates the order in which the mail exchangers should be accessed by other mail delivery systems.
        If the first priority doesn’t respond in a given amount of time, the mail delivery system tries the second one, and so on. Here are some sample mail exchange records:

hostname.company.com.    IN    MX    10    mail.company.com.
hostname.company.com.    IN    MX    20    mail2.company.com.

hostname.company.com.    IN    MX    30    mail3.company.com. 

In this example, if the first mail exchanger, mail.company.com, does not respond, the second one, mail2.company.com, is tried, and so on.
      The CNAME record, or canonical name record, is also commonly known as the alias record and allows hosts to have more than one name. For example, your web server has the host name
www, and you want that machine to also have the name ftp so that users can use FTP to access a different portion of the file system as an FTP root. You can accomplish this with a CNAME record. Given that you already have an address record established for the host name www, a CNAME record that adds ftp as a host name would look something like this:

www.company.com.       IN     A              204.176.47.2

ftp.company.com.          IN    CNAME      www.company.com.

When you put all these record types together in a zone file, or DNS table, it might look like this:
mail.company.com.           IN   A              204.176.47.9
mail2.company.com.         IN   A              204.176.47.21
mail3.company.com.         IN   A              204.176.47.89
yourhost.company.com.    IN   MX          10  mail.company.com.
yourhost.company.com.    IN   MX          20  mail2.company.com.
yourhost.company.com.    IN   MX          30  mail3.company.com.
www.company.com.          IN  A              204.176.47.2

ftp.company.com.              IN CNAME     www.company.com.

The SOA record, or start of authority record, contains global parameters for the zone and is easily the most crucial record in the zone file. There can be only one SOA per zone file. The SOA record might look something like this:



TABLE 3 . 6 Fields of the DNS SOA Record

TABLE 3 . 6 Fields of the DNS SOA Record (continued)

Note:
You can establish other types of records for specific purposes, but we won’t go into those in this book. DNS can become very complex very quickly, and entire books are dedicated to the DNS system.

The nslookup and dig commands are discussed further in Chapter 4, but a quick peek at a special function of the utility will help tie together the preceding material. The following output was generated by the nslookup utility. Notice the similarity to the actual SOA record shown earlier. Once nslookup is started, entering the command set type=SOA, followed by entering the domain for which you want to view the SOA information for that zone, will produce output similar to this:


C:\>nslookup
Default Server: ns.company.com

Address: 10.184.147.254


> set type=SOA
> company.com
Server: ns.company.com

Address: 10.184.147.254

Non-authoritative answer:
company.com
                primary name server = ns.company.com
               responsible mail addr = dns\.support.company.com
               serial = 55281
               refresh = 7200 (2 hours)
               retry = 3600 (1 hour)
               expire = 604800 (7 days)
               default TTL = 1800 (30 mins)
[output omitted]

>


Monday, December 2, 2013

Using HOSTS


Using HOSTS

Several automatic conversion systems are available to translate an IP address into a host name, and HOSTS is one of the simplest. You create a file called HOSTS, located in a particular folder or directory based on the requirements of the operating system, and enter a line in the file for every system. Here’s an example:

198.34.56.25 myserver.com #My server’s information
198.34.57.03 yourserver.com

Now comes the nasty part. You must store this ASCII file on every single workstation on your network; when you make a change, you must change the contents of the HOSTS file on every single workstation on your network. This is a simple but painful process inside a network. But what happens if you want to go outside of this network to other networks or to the Internet? The file size would be simply enormous. Fortunately, there are better solutions, as you will see in the next two sections.

Note:
 Any information entered to the right of a pound sign in a HOSTS file is ignored, so you can use this space for comments.

Internet Domain Organization


Internet Domain Organization

On the Internet, domains are arranged in a hierarchical tree structure. The following list includes some of the top-level domains currently in use:
com: A commercial organization. Most companies will end up as part of this domain.
edu: An educational establishment, such as a university.
gov: A branch of the U.S. government.
int: An international organization, such as NATO or the United Nations.
mil: A branch of the U.S. military.
net: A network organization.
org: A nonprofit organization.

Warning:
Unfortunately, the word domain is used in several ways, depending on the context. In talking about the Internet, a domain refers to a collection of network host computers. See Chapter 4, “TCP/IP Utilities,” for a discussion of how Microsoft Windows Server products define a domain.



Your local ISP is probably a member of the .net domain, and your company is probably part of the .com domain. The .gov and .mil domains are reserved strictly for use by the government
and the military within the United States. In other parts of the world, the final part of a domain name represents the country in which the server is located (.ca for Canada, .jp for Japan, .uk
for Great Britain, and .ru for Russia, for example). Well over 130 countries are represented on the Internet. The .com domain is by far the largest, followed by the .edu domain.
If you want to contact someone within one of these domains by e-mail, you just add that person’s e-mail name to their domain name, separated by an at (@) sign. Generically, it looks like this:

name@company.com 

To increase the number of domain names available for use—after all, there is only one mcdonalds.com domain name available—several alternative top-level domains have been suggested. 
These include .firm for businesses and companies, .store for businesses selling goods rather than services, .arts for cultural and entertainment organizations, and .info for informational services. The domains .cc, .biz, .travel, and .post are also in use on the Internet.
      ICANN assigns all Internet domain names and makes sure that a name is not duplicated. Names are assigned on a first come, first served basis, but if you try to register a name that
infringes on someone else’s registered trademark, your use of that name will be rescinded if the trademark holder objects.

Name Resolution Methods


Name Resolution Methods

Internet host names are used because they are easier to remember than the long dotted decimal IP addresses. A host name is typically the name of a device that has a specific IP address and on the
Internet is part of what is known as a Fully Qualified Domain Name (FQDN). An FQDN consists of a host name and a domain name. An example of an FQDN is hostname.company.com.

      Although we have phone numbers and can remember them when we need to, life would be difficult if we had to remember the phone numbers of all our friends and associates. We might be able to remember the numbers of as many as 10 friends and relatives, but after that, things would get a bit difficult. Therefore, we remember their names and have directories of names and the phone numbers. Likewise, it’s easier to remember www.microsoft.com than it is to remember 198.105.232.6 and look up the name to associate the IP address with it.

      The process of finding the IP address for any given host name is known as name resolution, and it can be performed in several ways: a HOSTS file, a request broadcast on the local network, DNS, and WINS. But before you read about that, you need to first understand Internet domains and how they are organized.

IP Proxy Servers


IP Proxy Servers

A proxy server is one of several solutions to the problems associated with connecting your intranet or corporate network to the Internet. A proxy server is a program that handles traffic to
external host systems on behalf of the client software running on the protected network; this means that clients access the Internet through the proxy server. It’s a bit like those one-way mirrors—
you can see out, but a potential intruder cannot see in.

Note:
Another mechanism used to monitor and control traffic between the Internet and an internal network is a firewall. Although the functions performed by proxy servers and firewalls are related and appear in combination products, they’ll be presented in different chapters here. You will find more information on firewalls in Chapter 9, “Fault Tolerance and Disaster Recovery,” while additional coverage of various proxies can be found in Chapter 8, “Network Access and Security.”

A proxy server sits between a user on your network and a server out on the Internet. Instead of communicating with each other directly, each talks to the proxy (in other words, to a “standin”).
From the user’s point of view, the proxy server presents the illusion that the user is dealing with a genuine Internet server. To the real server on the Internet, the proxy server gives the illusion that the real server is dealing directly with the user on the internal network. So a proxy server can be both a client and a server; it depends on which way you are facing. The point to remember here is that the user is never in direct contact with the Internet server, as Figure 3.6 illustrates.
       The proxy server does more than just forward requests from your users to the Internet and back. Because it examines and makes decisions about the requests that it processes, it can control
what your users can do. Depending on the details of your security policy, client requests can be approved and forwarded, or they can be denied. And rather than requiring that the same restrictions be enforced for all users, many advanced proxy server packages can offer different capabilities to different users. 

FIGURE 3 . 6 How a proxy server works



Warning:
A proxy server can be effective only if it is the only type of connection between an internal network and the Internet. As soon as you allow a connection that does not go through a proxy server, your network is at risk.


Proxy Server Caching
Many proxy servers can cache documents, which is particularly useful if a number of clients request the same document independently. With caching, the client request is filled more
quickly and Internet traffic is reduced. The types of caching are as follows: 
      Active Caching The proxy server uses periods of low activity to go out and retrieve documents that it thinks will be requested by clients in the near future.
      Passive Caching The proxy server waits for a client to make a request, retrieves the document, and then decides whether or not to cache the document.

Note:
Some documents, such as those from a paid subscription service or those that are subject to constant change (for example, documents from financial institutions, documents relating to stock ticker records, and those requiring specific authentication) cannot be cached.
Large companies may have multiple proxy servers, and two caching standards have emerged:

Internet Cache Protocol (ICP) Internet Cache Protocol (ICP) specifies a message format to be used for communications between proxy servers; these messages are used to exchange information
about the presence or absence of a specific web page in the proxy server cache. Unfortunately, ICP is not scalable, and the number of ICP messages exchanged between proxy servers climbs rapidly as the number of proxy servers increases.

Cache Array Routing Protocol (CARP) Cache Array Routing Protocol (CARP) offers a solution to the ICP problem by using multiple proxy servers with a single large cache. CARP removes the need for proxy server–to–proxy server communications and also prevents the information in the cache from becoming redundant over time. CARP is referred to as queryless distributed caching and is supported in Netscape and Microsoft proxy server products.



Classless Inter-Domain Routing (CIDR)


Classless Inter-Domain Routing (CIDR)

InterNIC no longer gives out addresses under the Class A, B, or C designations. Instead, it uses a method called Classless Inter-Domain Routing (or CIDR, which is usually pronounced “cider”).
CIDR networks are described as “slash x (/x)” networks; the x represents the number of bits in the IP address range that InterNIC controls, more easily seen as the number of bits in the subnet mask
set to 1. This allows InterNIC to define networks that fall between the old classifications, which means that you can get a range of addresses much better suited to your needs than in times past. In
CIDR terms, a network classified as a Class C network under the old scheme becomes a /24 network because InterNIC controls the leftmost 24 bits and you control the rightmost 8 bits. Table 3.5 shows some examples of /x network types.

Note:
You can also combine multiple classful networks into a single network using
this same designation system. This process is known as supernetting.
TABLE 3 . 5 Table 3.5Examples of CIDR Network Types


















Subnetting a Class C Network


Subnetting a Class C Network

How do you find out the values that you can use for a Class C network subnet mask? Remember from a previous discussion that InterNIC defines the leftmost three octets in a Class C address,
leaving you with the rightmost octet for your own host and subnetting use. If your network consists of a single segment, you have the following subnet mask:

11111111 11111111 11111111 00000000
When expressed as a decimal number, this is

255.255.255.0

Because all of your addresses must match these leftmost 24 bits, you can do what you’d like with the last 8 bits, given a couple of exceptions that we’ll look at in a moment.
       You might decide to divide your network into two equally sized segments, with, for example, the numbers 0 through 127 as the first subnet (00000000 through 01111111 in binary) and the
numbers 128 through 255 as the second subnet (10000000 through 11111111 in binary).
Notice how the numbers within each subnet can vary only in the last seven places. So, placing 1s in the mask where the bits should be identical for all hosts in a subnet, the subnet mask becomes

Because all of your addresses must match these leftmost 24 bits, you can do what you’d like with the last 8 bits, given a couple of exceptions that we’ll look at in a moment.
       You might decide to divide your network into two equally sized segments, with, for example, the numbers 0 through 127 as the first subnet (00000000 through 01111111 in binary) and the numbers 128 through 255 as the second subnet (10000000 through 1111111 in binary).

Notice how the numbers within each subnet can vary only in the last seven places. So, placing 1s in the mask where the bits should be identical for all hosts in a subnet, the subnet mask becomes

255.255.255.128
In binary this is

11111111.11111111.11111111.10000000

Note:
Use the Windows Calculator in scientific mode (choose View Scientific) to look at binary-to-decimal and decimal-to-binary conversions. Click the Bin (binary) button and then type the bit pattern that you want to convert. Click the Dec (decimal) button to display its decimal value. You can also go the other way and display a decimal number in binary form. This works great for hexadecimal and octal numbering systems, as well.

Now let’s get back to the exceptions mentioned earlier. The network number is the first number in each range, so the first subnet’s network number is X.Y.Z.0 and the second is X.Y.Z.128
(X, Y, and Z are the octets assigned by InterNIC). The default router address is commonly the second number in each range—X.Y.Z.1 and X.Y.Z.129—and the broadcast address is the last
address, or X.Y.Z.127 and X.Y.Z.255. You can use all the other addresses within the range as you see fit on your network.
Table 3.3 describes how you can divide a Class C network into four equally sized subnets with a subnet mask of 255.255.255.192. This gives you 62 IP addresses on each subnet once you have accounted for the network and broadcast addresses.


TABLE 3 . 3 Class C Network Divided into Four Subnets

Table 3.4 describes how you can divide a Class C network into eight equally sized subnets with a subnet mask of 255.255.255.224. This gives you 30 IP addresses on each subnet once you have accounted for the network and broadcast addresses. You can continue this trend for subnet masks with fourth-octet values of 240, 248, and 252. A fourth-octet value of 254 is widely regarded as unusable because the only possible values in each subnet have only 0s or 1s in the host portion, which are illegal for assignment to hosts.

TABLE 3 . 4 Class C Network Divided into Eight Subnets

Overview of IP Addresses


Overview of IP Addresses

TCP/IP requires that each interface on a TCP/IP network have its own unique IP address. There are two addressing schemes for TCP/IP: IPv4 and IPv6. You should know how these schemes differ.

IPv4
An IPv4 address is a 32-bit number, usually represented as a four-part decimal number with each of the four parts separated by a period or decimal point. You may also hear this method
of representation called dotted decimal or dotted quad decimal. In the IPv4 address, each individual byte, or octet as it is sometimes called, can have a value in the range of 0 through 255.

Note:
The term octet is the Internet community’s own term for an 8-bit byte. It came into common use because some of the early computers attached to the Internet had bytes of more than 8 bits; for example, DEC’s systems had blocks of 18 bits.

The way these addresses are used varies according to the class of the network, so all you can say with certainty is that the 32-bit IPv4 address is divided in some way to create an identifier for
the network, which all hosts on that network share, and an identifier for each host, which is unique among all hosts on that network. In general, though, the higher-order bits of the address make up the network part of the address and the rest constitutes the host part of the address. In addition, the host part of the address can be divided further to allow for a subnetwork address.
For more detail on this addressing scheme, see the sections “IPv4 Address Classifications” and “Understanding Subnets” later in this chapter. Some host addresses are reserved for special use. For example, in all network addresses, host numbers of all 0s and all 1s are reserved. An IPv4 host address with all host bits set to 0 in binary identifies the network itself, so 10.0.0.0 refers to network 10. An IP address with all host bits set to 1 in binary is known as a broadcast address. The broadcast address for network 172.16
is 172.16.255.255. A datagram sent to this address is automatically sent to every individual host on the 172.16 network.
American Registry for Internet Numbers (ARIN) assigns and regulates IP addresses on the Internet; you can get one directly from ARIN, or you can ask your Internet service provider (ISP)
to secure an IP address on your behalf. Another strategy is to obtain your address from ARIN and only use it internally until you are ready to connect to the Internet.


Note:
If you are setting up an intranet and you don’t want to connect to the outside world through the Internet, you don’t need to obtain a registered IP address from ARIN. Obtaining registered addresses from ARIN simply ensures that the addresses you use are unique over the entire Internet. If you are never going to connect to the Internet, there's no reason to worry about whether those addresses are the same as an address of a computer that isn't even on your network. Nowadays, however, it is rare to find an individual or organization that implements an IP-based internetwork that does not intend to connect to the Internet. More realistically, you might choose to use private address space (the 10.0.0.0 network, for example) internally while translating to a small pool of ARIN-registered addresses, using NAT, in order to communicate with the Internet, thus conserving public registered address space.



IPv4 Address Classifications
In an IPv4 address, the default number of bits used to identify the network and the host vary according to the network class of the address. While other methods, such as Classless Inter- Domain Routing, are currently more popular for specifying address space boundaries for entities of various sizes, the following classes of IP addresses originally offered a default set of

boundaries for varying sizes of address space and still provide a fallback mechanism for end and intermediate devices in the absence of ample subnetting information:





  1. Class A was designed for very large networks only. The default network portion for Class A networks is the first 8 bits, leaving 24 bits for host identification. The high-order bit is always binary 0, which leaves 7 bits available for IANA to define 127 networks. The remaining 24 bits of the address allow each Class A network to hold as many as 16,777,214 hosts. Examples of Class A networks include General Electric, IBM, Hewlett-Packard, Apple, Xerox,Compaq, Columbia University, MIT, and the private network 10.0.0.0. All possible Class A networks are in use; no more are available.
  2. Class B was designed for medium-sized networks. The default network portion for Class B networks is the first 16 bits, leaving 16 bits for host identification. The 2 high-order bits are always binary 10, and the remaining 14 bits are used for IANA to define 16,384 networks, each with as many as 65,534 hosts attached. Examples of Class B networks include Microsoft, Exxon, and the 16 private networks ranging from 172.16.0.0 to 172.31.0.0, inclusive. Class B networks are generally regarded as unavailable, but address conservation techniques have made some of these addresses become available from time to time over the years.
  3. Class C was designed for smaller networks. The default network portion for Class C networks is the first 24 bits, leaving 8 bits for host identification. The 3 high-order bits are always binary 110, and the remaining 21 bits are used by IANA to define 2,097,152 networks, but each network can have a maximum of only 254 hosts. Examples of Class C networks are the 256 private networks ranging from 192.168.0.0 to 192.168.255.0. Class C networks are still available.
  4. Class D is the multicast address range and cannot be used for networks. There is no network/ host structure to these addresses. They are taken as a complete address and used as destination addresses only, just like broadcast addresses. The 4 high-order bits are always 1110, and the remaining 28 bits allow access to more than 268 million possible addresses.
  5. Class E is reserved for experimental purposes. The first 4 bits in the address are always 1111.
Note:
One trick that works well, when faced with determining the class of an IP address written entirely in binary, is to assign the letters A through D to the first 4 bits, in alphabetical order. Wherever the first 0 falls signifies the class  of address with which you are dealing. If none of the first 4 bits are set to 0, then you have a Class E address.

Figure 3.5 illustrates the relationships among these classes and shows how the bits are allocated by the Internet Network Information Center (InterNIC), an Internet Corporation for
Assigned Names and Numbers (ICANN) licensed service mark. 


 FIGURE 3 . 5 The IP address structure


Because the bits used to identify the class are combined with the bits that define the network address, we can draw the following conclusions from the size of the first octet, or byte, of the address:

  • A value of 126 or less indicates a Class A address. The first octet is the network number; the next three, the host ID.
  • A value of exactly 127, while technically in the Class A range, is reserved as a software loopback test address. If you send an echo request to 127.0.0.1, the ping doesn’t actually generate any network traffic. It does, however, test that TCP/IP is installed correctly. Using this number as a special test address has the unfortunate effect of wasting almost 17 million possible IP addresses, a case of early-70s short-sightedness, much like the theory that 64KB of RAM should be enough for PCs.
  • A value of 128 through 191 is a Class B address. The first two octets are the network number, and the last two are the host address.
  • A value of 192 through 223 is a Class C address. The first three octets are the network address, and the last octet is the host address.
  • A value of 224 through 239 is a Class D multicast address. Again, there are no network or host portions to multicast addresses.
  • A value greater than 239 indicates a reserved Class E address.

IPv6
IPv6 was originally designed because the number of available unregistered IPv4 addresses was running low. Because IPv6 uses a 128-bit addressing scheme, it has more than 79 octillion
(that’s 79,000,000,000,000,000,000,000,000,000 to you and me) times as many available addresses as IPv4. Also, instead of representing the binary digits as decimal digits, IPv6 uses eight sets of four hexadecimal digits, like so:
3FFE:0B00:0800:0002:0000:0000:0000:000C

In addition, you can abbreviate these very long addresses by dropping leading 0s (zeros) (like the 0 before the B in “0B00”). You can also drop any single grouping of zero octets (as in the number above) between numbers as long as you replace them with a double colon (::) and they are complete octets (you can’t drop the three 0s in the second octet to make it just “B” instead of
“0B00,” for example). If you apply this rule (known as the zero compression rule) to the above address, it would make the example address look like so:
3FFE:0B00:0800:0002::000C

Note:
The private address spaces listed with each class description are specified in RFC 1918 as being available to anyone who wants to use IP addressing on a private network but does not want to connect these networks directly to the Internet. Private addresses are those addresses that are not permitted to be routed by Internet routers. In fact, ISPs can be fined for passing traffic with these addresses as source or destination. Conversely, public addresses are those IP addresses that are allowed to be passed by Internet routers. You can use the private address space without the risk of compromising someone else’s registered network address space. If you use a private address and decide to interconnect your intranet with the Internet, you may use NAT to do so.
As with IPv4, there are several addresses that are reserved for special uses. For example, the IPv6 address ::/0 is the default address for a host that has yet to be assigned an address (like
0.0.0.0 in IPv4). The address ::1/128 is reserved for the local loopback (like 127.0.0.1 in IPv4). IPv6 also includes provisions for the old IPv4 hosts so they can be migrated to the new addressing
scheme. This is accomplished by using the address ::xxx.xxx.xxx.xxx, where the last four sets of digits refer to the old IPv4 address.
      The way a host is configured is one very unique aspect of the IPv6 addressing scheme. Instead of an IP address, subnet mask, and default gateway, each station is required to have three different
addresses. First of all, the host has an address from each upstream supplier, a local address, and a link-local address. The local address is a number like ::1/128 that defines the local host. The link-local address is the address for the local subnet.
      Finally, IPv6 has some other unique addressing concepts, like autoconfiguration (similar to DHCP, but extended further) and neighbor discovery, whereby the IPv6 host discovers its network
surroundings.

Warning:
 You can’t use the zero compression rule to drop more than one grouping of zero octets. For example, you can’t make 3FFE:0000:0000:0002:0000:0000:0000:000C 
into 
3FFE::0002::000C. 
This is also part of the zero compression rule: There can be
only one set of double colons! Otherwise, receiving devices would not be able to reverse-engineer the number of missing zeros. Therefore, since it’s up to the human entering the address, compress the longer series of zeros.

Note:
For more information on IPv6, check out RFC 2373 at www.ietf.org.



Sunday, December 1, 2013

Overview of Ethernet Addresses


Overview of Ethernet Addresses

You may remember from an earlier section that TCP/IP is independent of the underlying network hardware. If you are running on an Ethernet-based network, be careful not to confuse the Ethernet hardware address and the IP address required by TCP/IP.
Each Ethernet network card (and any other NIC, for that matter) has its own unique hardware address, known as the media access control (MAC) address. This hardware address is predefined
and preprogrammed on the NIC by the manufacturer of the board as a unique 48-bit number.
The first three bytes of this address are called the Organizationally Unique Identifier (OUI) and are assigned by the Institute of Electrical and Electronics Engineers (IEEE). Manufacturers
purchase OUIs and then vary the last three bytes of the MAC address for each interface they produce, making each address unique provided no other manufacturer makes unauthorized use
of the OUI and related address space. Remember that the Ethernet address

Understanding IP Addressing


Understanding IP Addressing

As you know from the section “The Internet Layer Protocols” earlier in this chapter, IP moves data between computer systems in the form of a series of one or more packets, often making up
a TCP or UDP datagram, and each datagram is delivered to the IP destination system and to the port number (on that system) that is contained in the encapsulated TCP or UDP header. This
destination socket, or port and address combination, is a standard 48-bit number (a 32-bit IP address and a 16-bit port number) that contains enough information to identify the receiving network, the host for which the datagram is intended on that network, and the application running on that host.
        In this section, you’ll learn what IP addresses are, why they are so necessary, and how they are used in TCP/IP networking. But first, let’s clear up a possible source of confusion: Ethernet addresses and IP addresses.