Tuesday, August 31, 2010

DHCP(Dynamic Host Configuration Protocall)

􀂇 IP addresses can be


􀂇 Static IP address

􀃭Addresses that are manually assigned and do not

change over time

􀂇 Dynamic IP address

􀃭Addresses that are automatically assigned for a

specific period of time and might change
 
What is DHCP?


􀂇 It gives IP Addresses Automatically to the

Clients who is requesting for an IP Address

􀂇 Centralized IP Address Management

􀂇 DHCP prevents IP address Conflicts and helps conserve

the use of client IP Address on the Network

􀂇 DHCP reduces the complexity and amount of

administrative work by assigning TCP/IP configuration

􀂇 Client IP configuration is updated automatically
 
DHCP


􀂇 Authorization

It is a Security Precaution that ensures that only

Authorized DHCP Servers can run in the Network. To

avoid computers running Illegal DHCP Servers in the

network

􀂇 Scope

A scope is a range of IP addresses that are available to

be leased to clients
 
How DHCP Works


11 DHCP client broadcasts a DHCPDISCOVER packet

22 DHCP servers broadcast a DHCPOFFER paccket

33 DHCP client broadcasts a DHCPREQUEST packet

44 DHCP Server broadcasts a DHCPACK packet

DHCP
 
1


2

IP Addresses

􀂇 IP addresses can be

􀂇 Static IP address

􀃭Addresses that are manually assigned and do not

change over time

􀂇 Dynamic IP address

􀃭Addresses that are automatically assigned for a

specific period of time and might change

3

What is DHCP?

􀂇 It gives IP Addresses Automatically to the

Clients who is requesting for an IP Address

􀂇 Centralized IP Address Management

􀂇 DHCP prevents IP address Conflicts and helps conserve

the use of client IP Address on the Network

􀂇 DHCP reduces the complexity and amount of

administrative work by assigning TCP/IP configuration

􀂇 Client IP configuration is updated automatically

4

DHCP

􀂇 Authorization

It is a Security Precaution that ensures that only

Authorized DHCP Servers can run in the Network. To

avoid computers running Illegal DHCP Servers in the

network

􀂇 Scope

A scope is a range of IP addresses that are available to

be leased to clients

5

How DHCP Works

11 DHCP client broadcasts a DHCPDISCOVER packet

22 DHCP servers broadcast a DHCPOFFER paket

33 DHCP client broadcasts aa DHCPREQUEST packet

44 DHCP Server broadcasts a DHCPACK packet

DHCP

Client

DHCP

Server1

DHCP

Server2

6

What Is a DHCP Reservation?

1100..00..00..00

Workstation 11

DHCP ServerWorkstation 22

File Server

10.0.0.1: Leased to Workstation 1

10.0.0.2: Leased to Workstation 2

10.0.0.3: Reserved for File Server

􀂇 A reservation is a specific IP address,

within a scope, that is permanently reserved to

a specific DHCP client

7

What Are DHCP Scope Options?

DHCP Client

DHCP Servver

DHCP Client IP Configuration Data

Client􀂷s IP address

Client􀂷s subnet mask

DHCP Scope options

􀂇 DHCP Scope options are other server addresses

given to clients

8

How DHCP Server & Scope Options Are Applied

DHCP Server option applied

at the server level

DHCP at the Scope scope Scope A

10.0.0.0

Network

Scope B

11.0.0.0

Network

Windows XP

DHCP Server

Windows XP
Router

File Server

9

Lease Renewal Process

DHCP Client

DHCP

Server1

DHCP

Server2

11 DHCP client sends a DHCPREQUEST packet

22 DHCP Servre sennds a DHCPACK packet

50% of lease

duration has

of lease

87.5% 100% of lease

expired

If the client fails to renew its lease, after 50% of the lease

duration has expired, then the DHCP lease renewal process will

begin again after 87.5% of the lease duration has expired

it􀂷s lease, after 87.5% of the lease has

expired, then the DHCP lease generation process starts over

again with a DHCP client broadcasting a DHCPDISCOVER

cclliieenntt 50% of lease

duration has

expired
 
 
1


2

IP Addresses

􀂇 IP addresses can be

􀂇 Static IP address

􀃭Addresses that are manually assigned and do not

change over time

􀂇 Dynamic IP address

􀃭Addresses that are automatically assigned for a

specific period of time and might change

3

What is DHCP?

􀂇 It gives IP Addresses Automatically to the

Clients who is requesting for an IP Address

􀂇 Centralized IP Address Management

􀂇 DHCP prevents IP address Conflicts and helps conserve

the use of client IP Address on the Network

􀂇 DHCP reduces the complexity and amount of

administrative work by assigning TCP/IP configuration

􀂇 Client IP configuration is updated automatically

4

DHCP

􀂇 Authorization

It is a Security Precaution that ensures that only

Authorized DHCP Servers can run in the Network. To

avoid computers running Illegal DHCP Servers in the

network

􀂇 Scope

A scope is a range of IP addresses that are available to

be leased to clients

5

How DHCP Works

11 DHCP client broadcasts a DHCCPDISCOVER packet

22 DHCP servers broadcaast a DHCPOFFER paccket

33 DHCP client broadccasts a DHCPREQUEST packet

44 DHCP Server Broadcasts a DHCPACK packket

DHCP

Client

DHCP

Server1

DHCP

Server2

6

What Is a DHCP Reservation?

1100..00..00..00

Workstation 1

DHCP Server Worksation 2

File Serrver

10.0.0.1: Leased to Workstation 1

10.0.0.2: Leased to Workstation 2

10.0.0.3: Reserved for File Server

􀂇 A reservation is a specific IP address,

within a scope, that is permanently reserved to

a specific DHCP client

7

What Are DHCP Scope Options?

DHCP Client

DHCP Server

DHCP Client IP Configuration Data

Client􀂷s IP address

Client􀂷s subnet mask

DHCP Scope options

􀂇 DHCP Scope options are other server addresses

given to clients

8

How DHCP Server & Scope Options Are Applied

DHCP Server option applied

at the server level

DHCP at the Scope scope Scope A

10.0.0.0

Network

Scope B

11.0.0.0

Network

Windows XP


DHCP Server

Windows 98

Windows XP

Router

Fille Server

9

Lease Renewal Process

DHCP Client

DHCP

Server1

DHCP

Server2

11DHCP Client sends a DHCPREQUEST packet

22 DHCP Server1 sends a DHCPACK packket

50% of lease

duration has

of lease

87.5% 100% of lease

expired

If the client fails to renew its lease, after 50% of the lease

duration has expired, then the DHCP lease renewal process will

begin again after 87.5% of the lease duration has expired

it􀂷s lease, after 87.5% of the lease has

expired, then the DHCP lease generation process starts over

again with a DHCP client broadcasting a DHCPDISCOVER

cclliieenntt 50% of lease

duration has

expired

Dynamic Website using Php & MySQL

Subnetting?

Subnetting 1 2 3 By Upendra Singh


Ever get stressed out because you know that there would be subnetting question(s) in the next exam you are taking and that these questions easily take up 10 to 20 minutes of your precious exam time? What if there is more than one question?


The process of converting the subnet to binary and decimal can drive the unfamiliar insane, not to mention the waste of precious time and brain power which can be utilized for other areas of exam preparation.


Let's take a look at a shortcut method that will cut down the time needed to answer these questions without the need for a calculator.


Subnet Basics:


This article assumes that you know how to perform subnetting in the traditional method but it is important to stress that there are only 3 classes of usable IP addresses which are


Class


Range


Subnet mask


Host bit


Subnet


Class A


1 - 126 (127 is reserved for loopback)


255.0.0.0


24


8


Class B


128 - 191


255.255.0.0


16


16


Class C


192 - 223


255.255.255.0


8


24


You must understand and remember this table well in order to master the shortcut.


Note: You must borrow at least 2 bits and must leave at least 2 bits


The 'Subnet Table'


Bits Borrowed (N)


1


2


3


4


5


6


7


8


Bit Value


128


64


32


16


8


4


2


1


Subnet Mask


128


192


224


240


248


252


254


255


Number of Subnets ((2^N)-2)


0


2


6


14


30


62


126


254


If using the (2^N) method as defined in RFC 1878, your table would look like this instead.


Bits Borrowed (N)


1


2


3


4


5


6


7


8


Bit Value


128


64


32


16


8


4


2


1


Subnet Mask


128


192


224


240


248


252


254


255


Number of Subnets (2^N)


2


4


8


16


32


64


128


256


The 'subnet table' is commonly seen in lecture notes or certification guides, but what the author/lecturer did not tell you is how to derive this table on the fly. Its actually quite


Subnetting 1 2 3 080119.doc Page 1 of 3


simple, lets look at it line by line.


1) Bits borrowed, this is the easy one, just remember that the table consists of only 8 columns.


2) Bits Value, remember by heart that the first value starts with 128 and the subsequent values are divided by two.


3) Subnet Mask, this line tells you what the subnet mask would be, to get the figures, add up the corresponding bits value and all of the values prior to it.


128 + 0 (there is no prior value) =128 128 + 64 = 192 192 + 32 = 224 224 + 16 = 240 240 + 8 = 248 248 + 4 = 252 252 + 2 + 254 254 + 1 + 255


4) Number of Subnets, tells you how many subnet you'll get if you use the subnet mask. Just look at the corresponding N value at the top and you can derive the figures.


Once you understand how to derive the 'subnet table', spend some time practicing. I would advise you to draw out the table once you are in the exam room (before starting the actual exam) it will take you less than a minute.


How to tackle the questions


There are only a few different ways that Microsoft or Cisco can phrase their questions, lets take a look at some examples,


Question Type 1: If you are to determine the subnet mask based on a number of hosts and an IP address


Example: You are assigned an IP address of 172.30.0.0 and you need 1000 hosts on your network, what is your subnet mask.


Step one: Determine the number of bits needed for the hosts. In this scenario, we need ten bits as 2^10 = 1024 (the question asks for 1000 hosts only)


Step two: Determine the number of bits left for the subnet. 32 - (number of bits needed for the host) which is 32-10 = 22 bits


Step three: Determine the number of bits actually borrowed. We take the number of bits left for the subnet and minus as many 8s as possible as each 8 represents 1 octal. Therefore 22 - 8 - 8 = 6 bits were borrowed


Bits Borrowed (N)


1


2


3


4


5


6


7


8


Bits Value


128


64


32


16


8


4


2


1


Subnet Mask


128


192


224


240


248


252


254


255


Number of Subnets (2N-2)


0


2


6


14


30


62


126


254


With reference to the subnet table, 6 bits would have a subnet of 255.255.252.0 . Take note


Subnetting 1 2 3 080119.doc Page 2 of 3


Subnetting 1 2 3 080119.doc Page 3 of 3


that a total of two 8s were subtracted off, therefore the first two octal would be 255.255.x.x and the 3rd octal was 6 bits borrowed which leaves with 255.255.252.x.


Simple?


Question Type 2: If you were given an IP address of 172.30.0.0 and you need 15 subnets


Bits Borrowed (N)


1


2


3


4


5


6


7


8


Bits Value


128


64


32


16


8


4


2


1


Subnet Mask


128


192


224


240


248


252


254


255


Number of Subnets (2N-2)


0


2


6


14


30


62


126


254


With reference to the subnet table, the subnet mask should be 255.255.248.0. 172.30.0.0 is a Class B address and the subnet should be 255.255.0.0.


Question Type 3: You are assigned an IP address of 172.30.0.0 and you need 55 subnets, how many hosts do you have per subnet?


Step One: Determine the number of bits used for the subnet.


Bits Borrowed (N)


1


2


3


4


5


6


7


8


Bits Value


128


64


32


16


8


4


2


1


Subnet Mask


128


192


224


240


248


252


254


255


Number of Subnets (2N-2)


0


2


6


14


30


62


126


254


According to the chart, the closest match to 55 subnet would be 62 and therefore, the number of bits borrowed for the subnet is 6. Since 172.30.0.0 is a Class B, we would need to add another 16 bits to the 6 making it 22 bits in total.


Step Two: Determine the number of bits used for the host.


Number of bits used for the hosts is 32 - (number of bits used for the subnet) which is 22 = 10 bits.


2^10-2 = 1022, therefore there are a total of 1022 usable hosts in each subnet.


The key to mastering this shortcut is the same as with any other mathematical question - practice.


Good luck on your next exam


By Adam Chee W.S. (MCP ID 2915249) http://www.adamchee.cjb.net

Subnetting in Easy Steps

1 © 2001 Kevin Lillis, klillis@sau.edu



Subnetting


Subnetting is used to subdivide a single class of network in to multiple smaller networks.


Example:


Your organization has a Class B IP address of 166.144.0.0 Before you implement


subnetting, the Network ID and Host ID are divided as follows:


octet 1 octet 2 octet 3 octet 4


Network ID Host ID


To organize your network and allow for growth, you decide to use the 3rd octet to


subdivide your network into subnets.


Now the Network ID and Host ID are divided as follows:


octet 1 octet 2 octet 3 octet 4


Network ID Subnet ID Host ID


Extended Network Prefix


Subnet Mask


In order to distinguish between the extended network prefix and the Host ID you use a


subnet mask.


A subnet mask fills each bit of the extended network prefix with a 1 and each bit of the


Host ID with a 0.


In the above example the network mask would be:


11111111 11111111 11111111 00000000


Which in dotted decimal notation is:


255.255.255.0


A router combines the destination IP address with the subnet mask, using a logical AND


operation, to determine the network address.


Continuing with the same example, a destination address of 166.144.56.9 is


combined with the subnet mask of 255.255.255.0 as follows:


10100110 10010000 00111000 00001001 (166.144.56.9)


AND 11111111 11111111 11111111 00000000 (255.255.255.0)


10100110 10010000 00111000 00000000 (166.144.56.0)


After combining the destination address with the subnet mask, the result is the extended


network prefix. In effect, the host potion of the address has been stripped off.


Default Subnet Masks


There is a default subnet mask for each of the three Classes of IP address:


Class A: 255.0.0.0


Class B: 255.255.0.0


Class C: 255.255.255.0


Another Example


Your company has a Class C network of 201.222.10.0 and you want to use


subnetting. You cannot simply use the next available octet following the Network ID as


in the previous example. If you did, there would be no portion of the IP address left for


the Host ID.


Therefore, you need to use one portion of the last octet as the Subnet ID and another


portion of the last octet as the Host ID.


To do this you must follow these general steps:


Step 1 – Determine the number of subnets required by your installation


Step 2 – Determine the number of bits, n, needed for the Subnet ID field


Step 3 – Determine the number of bits, m, needed for the Host ID field


Step 4 – Determine the subnet mask for your network


Step 5 – Determine the total number of subnets available


Step 6 – Determine the maximum number of hosts per subnet


Step 7 – For each subnet determine:


a) The network address


b) The range of host addresses


c) The broadcast address


Step 1 – Determine the number of subnets required by your installation


This will depend on your current installation and is used as the starting point


for this discussion. In this example we will assume that we require 17 subnets.


Step 2 – Determine the number of bits, n, needed for the Subnet ID field


This can be done in two ways. The first way is intuitive and involves simply


looking at the decimal values of various binary numbers and deciding the


minimum number of bits required to represent the number of subnets.


The second way is more analytic. The number of bits required is defined by


the following equation:


number of subnets = 2n – 2


Once you know the number of subnets required, you can solve the equation for


n to determine the number of bits to use for your Subnet ID.


In this example the number of subnets needed is 17. Therefore,


17 = 2n – 2


Solving for n


Since it makes no sense to talk about 4.2 bits, we will say that the number of


bits required to represent our 17 subnets is 5.


Step 3 – Determine the number of bits, m, needed for the Host ID field


This is defined as


m = 32 – number of bits in the Network Address – n


In this example we have a Class C address which uses the first three octets (24


bits) for the Network ID. In the previous step we determined that n = 5. So


m = 32 – 24 – 5


m = 3


Step 4 – Determine the subnet mask for your network.


As stated above, a subnet mask fills each bit of the extended network prefix


with a 1 and each bit of the Host ID with a 0. So first the extended network


prefix needs to be identified. One way to do this is to write the network IP


address in its binary form and draw a vertical line just to the right of the


Network ID field.


Network IP network address = 201.222.10.0


in binary this is


11001001 11011110 00001010 00000000


Next, count n bits from the vertical line and draw a second vertical line.


11001001 11011110 00001010 00000000


These two vertical lines divide the 32 bit IP address into three sections,


corresponding to the Network ID, Subnet ID, and Host ID fields respectively.


The extended network prefix consists of the Network ID and Subnet ID fields.


Filling each bit in these fields with a 1 and filling the bits of the Host ID field


with 0 will give us the network mask.


11111111 11111111 11111111 11111000


In dotted decimal notation this is


subnet mask = 255.255.255.248


Step 5 – Determine the total number of subnets available


This can be determined by


number of subnets = 2n – 2


where n = the number of bits used for the Subnet ID field.


in this example n = 5, so


number of subnets = 25 – 2 = 30


Step 6 – Determine the maximum number of hosts per subnet


This is defined as


number of hosts per subnet = 2m – 2


where m = the number of bits used in the Host ID field


In this example m = 3, so


number of hosts per subnet = 23 – 2 = 8 – 2 = 6


Step 7 – For each subnet determine:


a) The network address


b) The range of host addresses


c) The broadcast address


In this example there are 30 possible subnets. We will consider only one.


a) Determine the network address


We will select the first subnet, which is


11001001 11011110 00001010 00001000


In dotted decimal notation this is


201.222.10.8


b) Determine the range of the host addresses


In any IP address, the Host ID field can contain any combination of 1s and


0s, except the combination of all 1s and the combination of all 0s.


Therefore the first host address is


11001001 11011110 00001010 00001001


In dotted decimal notation this is


201.222.10.9


The last host address would likewise be


11001001 11011110 00001010 00001110


In dotted decimal notation this is


201.222.10.14


So the range if host addresses is 201.222.10.9 to 201.222.10.14


c) Determine the broadcast address


In broadcast address for an IP network simply fills the Host ID field with


all 1s. So the broadcast address would be


11001001 11011110 00001010 00001111


In dotted decimal notation this would be


201.222.10.15

Subnetting In Seven Steps

Seven Steps to Subnetting



Excerpt from MCSE Guide to Microsoft® Windows 2000® Networking Certification Edition, written by Kelly Caudle, Walter J. Glenn, and James Michael Stewart; published by Course Technology


Creating Class C Subnetting Scheme


Basic subnetting is very easy when performed in seven steps. This example uses the Class C address 211.212.10.0. Using the seven steps provided here, you can create a subnetting scheme that allows you to use this address on your network.


Step 1: Determining Number of Subnets Needed


Determining the number of subnets you need is the very first step in subnetting. The number really depends upon your particular network. In Figure 2-3, the network consists of three routers connected via serial links. Each router also has a single Ethernet network attached.


Each shared serial link requires one subnet. Therefore, you need two subnets for the serial links between Router A and Routers B and C. You must also have one subnet per Ethernet interface on each router. Since you have three Ethernet networks, you need three subnets. Using this very simple counting method, you find that you need a total of five subnets. Unfortunately, you have been assigned a Class C address. The network address 211.212.10.0 allows for a single network of 254 hosts. You must borrow host ID bits to make this address work for you.


Step 2: Determining Number of Bits You Can Borrow


In Step 2, you must determine the number of bits that you can borrow. This number changes depending on the type of network address you start with. For Class A addresses, you have 24 host ID bits, but you can only borrow up to 22. For Class B addresses, you have 16 host ID bits, but you must have a minimum of two host bits; therefore, you can borrow 14 bits. Your Class C address (211.212.10.0) has eight total


host ID bits, but you can only borrow a maximum of six. The easiest way to determine the number of bits you can borrow is to write the number of octets that contain host ID bits in binary. In the Class C example network 211.212.10.0, you have the following bits to “play” with:


00000000


Step 3: Determining Number of Bits You Must Borrow to Get Needed Number of Subnets


After you determine the number of subnets you need and the number of bits you can borrow, you must calculate the number of host ID bits you must borrow to get the needed number of subnets. The formula for determining the number if bits you must borrow is 2n-2= # of subnets. The n represents the number of bits you borrow. In other words, raise two to the power of the number of bits you borrow and subtract two from that number. The result is the number of useable subnets created when you borrow that number of bits. For the example network, you need five subnets. If you borrow three bits, the formula’s result is six usable subnets: 23 = 8-2 = 6.


Step 4: Turning On Borrowed Bits and Determining Decimal Value


In Step 4, using the bits you determined were available in Step 2, you turn on (set to 1) the number of bits determined you must borrow in Step 3. You must always begin with the high-order bits (the bits starting on the left of a binary number). Using the number of bits you can work with and the number of bits you must borrow (from Step 3), your result is the following: 11100000. In other words, from the eight total bits from Step 2 (six of which you could borrow), you borrow three host ID bits. In Step 4, you also need to determine the decimal value of the octets from which you borrow host ID bits. In this example, 11100000 equals 224. (128 + 64 + 32 = 224)


Step 5: Determining New Subnet Mask


Step 5 calculates the new subnet mask after you borrow the host ID bits in Step 4. You must add the decimal value from Step 4 to the default subnet mask for the class of address you are subnetting. The example is a Class C address, so the default mask is 255.255.255.0. The new mask after borrowing three bits becomes 255.255.255.224.


Step 6: Finding Host/Subnet Variable


In Step 6, you must find the lowest of the high-order bits (bits starting from the left) turned “on.” Step 6 takes you all the way back to earlier in the chapter to the values found in each bit position within the octet. Our example defines the octets from which we borrow as 11100000. The highest order bit turned on represents 25, which equals 32. Since 25 is the last high-order bit turned on, the Host/Subnet variable you use in Step 7 is 3


Step 7: Determining Range of Addresses


The final step allows you to take the Host/Subnet variable from Step 6 (32) and create your subnet ranges. Using the Class C network above, the range of subnets when you borrow three bits are:


211.212.10.0 to 211.212.10.31


211.212.10.32 to 211.212.10.63


211.212.10.64 to 211.212.10.95


211.212.10.96 to 211.212.10.127


211.212.10.128 to 211.212.10.159


211.212.10.160 to 211.212.10.191


211.212.10.192 to 211.212.10.223


211.212.10.224 to 211.212.10.255


IP addresses cannot be all ones or all zeros; therefore, in most cases the first range of addresses and the last range of addresses are unusable. (In some special circumstances, you can use the first range of addresses, or subnet 0. Only certain manufacturers’ equipment, such as Cisco Systems, fully supports the use of subnet zero.) In each subnet, the first IP address is unusable because it represents the subnet ID. The final address is also unusable because it is the broadcast address for the subnet. Due to these two restrictions, in subnet one, 211.212.10.33 is the first useable host ID and 211.212.10.62 is the last useable host ID.


Tailoring a Class B Address


This example takes a Class B address and tries to fit it within the needs of a network containing 1000 subnets. You are assigned the Class B address 131.107.0.0. Using the following seven steps, you are going to subnet the Class B address to meet your needs.


Step 1: Determining Number of Subnets Needed


Examine your network and determine your needs based on current network configuration and future growth (in this case, 1000 subnets).


Step 2: Determining Number of Bits You Can Borrow


With this Class B network address, you have 16 total bits to work with. You can only borrow up to 14 of these. On your sheet of paper, you should write the number of bits you have in the host ID portion of the address:


00000000.00000000


Step 3: Determining Number of Bits You Must Borrow to Get Number of Subsets Needed


Using the formula 2n-2= # of usable subnets, you can easily see that you need to borrow 10 bits. When you plug in 10 borrowed bits, you get the following result:


210 = 1024 – 2 = 1022 useable subnets


Step 4: Turning on Borrowed Bits and Determining Decimal Value


If you turn on 10 bits, you get the following:


11111111.11000000


The decimal values for the octets are 255.192.


Step 5: Determining New Subnet Mask


Your example is a Class B address. In Class B addresses, the default subnet mask is 255.255.0.0. To get your new mask, you add the default mask to the decimal values found in Step 4. The new mask becomes:


255.255.255.192


Step 6: Finding Host/Subnet Variable


In the next-to-last step, you must find the value of the lowest high-order bit turned on in each octet, from which you borrowed host bits. Since this example is a Class B network and you must borrow a great number of bits to get the proper number of subnets, the borrowing crosses an octet boundary. As a result, you have two Host/Subnet variables. In this example, the variable in the third octet is 1, and the variable for the fourth octet is 64. You get these values by looking at the binary numbers in Step 4. The third octet has the final bit position, or the 20 bit position, turned on. Since 20 = 1, your variable is 1 in the third octet. In the fourth octet, the second high-order bit or 26 is turned on. The variable in this octet is 64.


Seven Steps to Subnetting v02.doc Page 4 of 5


Seven Steps to Subnetting v02.doc Page 5 of 5


Step 7: Determining Range of Addresses


Figuring the range of addresses for Class B networks is much harder than for Class C. This is especially true in cases like this scenario in which you must borrow a large number of bits. Using 1 as the variable in the third octet and 64 as the variable in the fourth octet, the range of the first 9 subnets world be:


131.107.0.0 to 131.107.0.63


131.107.0.64 to 131.107.0.127


131.107.0.128 to 131.107.0.191


131.107.0.192 to 131.107.0.255


131.107.1.0 to 131.107.1.63


131.107.1.64. to 131.107.1.127


131.107.1.128 to 131.107.1.191


131.107.1.192 to 131.107.1.255


131.107.2.0 to 131.107.2.63

Windows XP Boot Process/Boot Sequence In A Nutshell

What about Windows XP?


● Boot Loader Phase

● Kernel loading phase

● Session Manager

● Winlogon
 
 
Windows XP and earlier


● NTLDR – the actual boot loader

● boot.ini – booting options

● presents menu options as to what OS to load

● if absent, defaults to \Windows directory of first

partition
 
What NTLDR does


● Accesses the file system on boot drive

● Looks for hiberfil.sys, the hibernation image

● Reads boot.ini and prompts the user

● Runs NTDETECT.COM

● Starts NTOSKRNL.EXE
 
 
NTOSKRNL.EXE


● Kernel image of Windows NT family

● Contains

● Cache Manager

● Executive

● Kernel

● Security Reference Monitor

● Memory Manager

● Scheduler

● Also known as:

● NTOSKRNL.EXE : 1 CPU

● NTKRNLMP.EXE : N CPU SMP

● NTKRNLPA.EXE : 1 CPU, PAE

● NTKRPAMP.EXE : N CPU SMP, PAE
 
 
Kernel Loading Phase


● HAL.DLL -- type of hardware abstraction layer

● KDCOM.DLL -- Kernel Debugger HW Extension

DLL

● BOOTVID.DLL -- for the windows logo and

side-scrolling bar

● config\system registry
 
 
Session Manager


● SMSS.EXE

● What it does:

● Creates environment variables

● Starts the kernel and user modes of the Win32 subsystem

– win32k.sys (kernel-mode)

– winsrv.dll (user-mode)

– csrss.exe (user-mode)

● Creates DOS device mappings listed at the

HKLM\System\CurrentControlSet\Control\Session

Manager\DOS Devices registry key.

● Creates virtual memory paging files.

● Starts winlogon.exe, the Windows logon manager
 
 
Windows Logon


● Winlogon starts the Local Security Authority

Subsystem Service (LSASS) and Service

Control Manager (SCM)

● Also responsible for responding to the secure

attention sequence (SAS), loading the user

profile on logon, and optionally locking the

computer when a screensaver is running.
 
What about Windows Vista?


● Windows Boot Manager (bootmgr)

● Boot Configuration Data

● replacing boot.ini

● found in \Boot\Bcd

● winload.exe

● operating system boot loader

● NTOSKRNL.EXE and device drivers

Booting Sequence of Unix/Linux based Systems

A closer look at GRUB


● GRUB understands ext2 and ext3 file systems

● LILO had to load raw sectors from the hard disk

● GRUB displays a list of available kernels

● On Ubuntu, defined in /boot/grub/menu.lst
● More info: http://www.gnu.org/software/grub/
 
 
What does GRUB load?


title Ubuntu 9.04, kernel 2.6.2813generic

uuid 0ef7b971

kernel /boot/vmlinuz2.6.2813generic

root=UUID=0ef7b971 ro quiet splash

initrd /boot/initrd.img2.6.2813generic

● kernel – a compressed kernel image

● Performs initial minimal hardware setup

● Decompresses the kernel image, puts it in memory

● If present, loads RAM disk (see below)

● initrd – initial RAM disk

● Temporary root file system

● Contains executables and drivers to load the real root
 
Execution in the kernel


● arch/i386/boot/head.S

● performs basic hardware setup

● calls startup_32() of ./arch/i386/boot/compressed/head.S

● arch/i386/boot/compressed/head.S

● set up the basic environment

● clear Block Started by Symbol

● calls decompress_kernel() found in ./arch/i386/boot/compressed/misc.c

● calls startup_32 in ./arch/i386/kernel/head.S

● arch/i386/kernel/head.S

● also called swapper or process 0

● initializes page tables and enables memory paging

● detects CPU type

● init/main.c

● calls start_kernel()

● calls kernel_thread to start init (process ID 1)
 
initrd


● Initial RAM disk – a small temporary file system

● During stage 2 boot, initrd is copied into RAM

and mounted

● Allows the kernel to fully boot without having to

mount any physical disks

● Supports many hardware configurations

through loadable modules

● After kernel is booted, the real root file system

is mounted
 
init


● The first user space program -- /sbin/init

● Typical for desktop Linux systems

● For Ubuntu, init reads /etc/event.d

● see https://launchpad.net/upstart/

● default run level defined at /etc/event.d/rc-default

● for normal start, Ubuntu is at run level 2

● executes programs from /etc/rc2.d

● For other Linux systems, init reads /etc/inittab
 
Sources


● “Inside the Linux Boot Process”, M. Tim Jones, IBM Developerworks

● http://www.ibm.com/developerworks/linux/library/l-linuxboot/

● “Linux initial RAM disk overview”, M. Tim Jones, IBM Developerworks

● http://www.ibm.com/developerworks/linux/library/l-initrd.html