Networking 101
Networking 101
An Introduction to Networking
Don Colton
Brigham Young University–Hawai‘i
Note (April 2012): This book is mostly complete. A year ago it was in
active development. Content is still being revised but things are mostly
stable. Suggestions are welcome: email [email protected]
Networking 101: This is a “first things” book. What are the first things
we need to know about networking? Answering that question and teaching
those things to you is our goal.
Networking 101 is generally targeted towards students studying toward a
bachelor’s degree in Computer Science, Information Systems, or Information
Technologies. It also applies to persons that are simply interested in a
general introduction to data communications and networking. The depth of
coverage is suitable to an introductory one-semester course that meets for
about forty hours.
We focus on target concepts, topics, and skills that are normally expected of
students who have passed such a course. We also cover the basic skills and
concepts that support these target objectives. And we do some preparation
for more advanced courses in networking.
Target Skills
1
2
Skill: Internet: Students should know how the Internet works. This in-
cludes topics such as connecting to the Internet, using the domain name
system and using dynamic host configuration. These basics are covered
starting with chapter 1 (page 10).
Skill: Security: Students should know what security they have and whether
they need more. Includes password selection, firewalls, and issues with open-
ing up ports for gaming or whatever. Does sharing our Wi-Fi put us in any
danger? This is covered starting in chapter 23 (page 145).
Skill: Servers: Networks often involve the sharing of printer and files. This
can be done by adding network-ready printer or storage. But often it is
done by sharing parts of existing computer systems, such as their printer or
hard drive. How this is done depends a lot on the operating system of the
computer that will be doing the sharing.
We will address these tasks in the context of Microsoft Windows. Specifically
we will look at printer sharing, file sharing, and configuring ad hoc wireless
networks. This is covered starting with chapter 17 (page 105).
Basic Skills
The target skills, mentioned above, are things you probably already intend
to learn.
3
Some of the target skills can be memorized, but many cannot. Instead, they
must be understood. Basic concepts come up like domain names, SSIDs, IP
addresses, network masks, and ports.
The basic skills and concepts are those other things we have to learn first
before we can be truly proficient in the target skills. They are things that
perhaps we didn’t intend to learn. They may not be as glamorous. We may
not know they even exist. But we don’t score baskets in basketball (the
target skill) unless we are also good at dribbling (the basic skill).
Skill: Theory: Understand the following basic concepts: OSI 7-layer stack,
protocol data units (packets, frames, etc.), udp, tcp, arp, ports (21, 22, 25,
80, 443). This is covered starting with chapter 6 (page 36).
Skill: Power Tools: Students should be able to properly use these tools:
ping, traceroute, ipconfig, dig, nmap, ssh, telnet, ftp, and Wireshark. These
are the tools of the trade often used by networking professionals. Students
should be either skilled or familiar with them. They are covered in chapters
31 (page 216), 32 (page 233), and 33 (page 239).
Notation
The following notation is used in this book to help identify important types
of content.
Test Bank
As material is covered in the book, exam questions are inserted to show what
the student should be learning. These exam questions appear throughout the
book, together with acceptable answers. At the back of the book, Appendix
A (page 320) is a Test Bank. It repeats these same questions that appeared
throughout the book, but without their answers.
The Test Bank is a way for students to test themselves by reviewing the
questions and making sure they know at least one acceptable answer.
(The acceptable answers provided are often just the most simple answer
I have found that covers the question adequately. There are often much
more complete and accurate answers that go far beyond the minimal answer
shown as “acceptable.” Please forgive me for that.)
The Test Bank is also a way for teachers to be reminded of specific things
that I think students should be able to answer.
In many cases the questions and answers summarize material that is pre-
sented nearby in substantially greater detail.
In other cases the questions and answers are the actual presentation of that
material. This is especially true when the specific material is something
simple like vocabulary, and repetition would be tiresome and redundant.
Following is the format in which questions and answers are presented.
Exam Question 1 (p.320): What are target skills?
Acceptable Answer: Target skills are the skills we intend to gain.
Exam Question 2 (p.320): What are basic skills?
Acceptable Answer: Basic skills are the skills we must learn before we
can be good at the target skills.
The questions are hot-linked to make it easy for the student to jump back
and forth between the test bank and the content chapters.
Contents
I Networking Basics 9
II OSI Model 35
7 IP Addressing Preview 46
9 Anatomy of a Hop 56
5
CONTENTS 6
13 Home Router 82
17 Servers 105
V Security 132
21 Passwords 133
23 Authentication 145
25 Firewalls 162
CONTENTS 7
29 VLSM 202
30 Ports 208
IX Routing 257
X IPv6 295
Index 353
Unit I
Networking Basics
9
Chapter 1
Contents
1.1 The URL . . . . . . . . . . . . . . . . . . . . . . . 11
1.2 Protocols . . . . . . . . . . . . . . . . . . . . . . . 11
1.3 Domain Names . . . . . . . . . . . . . . . . . . . . 12
1.4 Paths . . . . . . . . . . . . . . . . . . . . . . . . . . 13
1.5 Endians . . . . . . . . . . . . . . . . . . . . . . . . 14
For most people, the first exposure to the Internet comes in the form of a
web browser. It is a living newspaper. It is a source of entertainment. It
is a window into the library of the world. For retrieving content, it uses a
(somewhat cryptic) system called the URL.
The information itself lives on servers. A server is normally another com-
puter, somewhere else in the world, that provides services to people like
ourselves. The URL is the browser’s way of finding that server and request-
ing the content that we desire.
What is the Web? The web, or world wide web, is a common name for the
Internet. But it is not the whole Internet. It refers specifically to that part
of the Internet where web pages live.
What is the Internet? The Internet includes the whole collection of all
web sites and other services (of which there are many) that are connected
together in a world-wide network of resources and components. It is much
bigger than the web, but the web is its most familiar face.
Exam Question 3 (p.320): What’s the difference between the Web and
10
CHAPTER 1. EXPLORING THE WEB 11
the Internet?
Acceptable Answer: The Web refers to web sites. The Internet is bigger.
It includes web sites and other things like network time synchronization,
email, gaming, Skype (VoIP), and Google Earth.
1.2 Protocols
Required Answer: no
Exam Question 11 (p.321): Does capitalization matter with URLs?
Required Answer: yes
In some parts of the URL, such as the path or file name, capitalization
matters. In other parts, such as the domain name, it does not.
Because capitalization does not matter with domain names, it is all the same
to the network if we can say “doncolton.com” or “DonColton.COM”.
This can confuse people because they see the URL written with different
capitalization in the domain name and they assume they can use different
capitalization everywhere in the URL. Not true.
Exam Question 12 (p.321): What is the structure of a domain name?
Acceptable Answer: little-endian
Domain names are hierarchical. The most specific, least substantial part, or
little end, comes first. The later parts own the earlier parts.
The terms little-endian and big-endian are discussed in section 1.5 (page
14).
The domains x.abc.com and y.abc.com are related to each other. Both are
sub-domains of (owned by) abc.com.
The domains abc.com and abc.org might not be related to each other. Or
they might be. We cannot tell from the domain name.
Chapter 4 (page 25) looks at the domain name system in greater detail.
1.4 Paths
Paths are normally hierarchical. The most general, most substantial part,
or big end, comes first. The later parts are subdivisions of the earlier parts.
By design, the path is intended to be hierarchical. Strictly speaking, the
path is not actually required to have any special meaning. It is just the
name of the object we wish to retrieve.
/networking/2011/ would usually be the directory or folder on the server.
book.pdf would usually be the filename on the server. If we decide to save
a copy of it on our local computer, this would probably be name suggested
by the browser.
.pdf would usually indicate the type of file at that location.
Because path names were historically built out of folder names and file
names, and often still are, we can sometimes trim off the last piece and
retrieve again. This may get us additional information. For example, if
“/networking/2011/book.pdf” is the path we are given, we could try to
retrieve just “/networking/2011/” or “/networking/” or “/”. We might
find a directory containing several items, including “book.pdf” as well as
“answerkey.pdf” and “quiz1.pdf”. Or maybe not. But it may not hurt to
look.
1.5 Endians
Also, avoid words like “big” or “little” because they just create circular
definitions.
Numbers are big-endian. In the number 123, the 1 represents 100s, the 2
represents 10s, and the 3 represents 1s.
Telephone numbers are big-endian. In the number 808-675-3478, the 808 is
an area code. Within that area code, 675 is a telephone exchange. Within
that exchange, 3478 is an individual telephone number.
Times are big-endian. 12:47:13 means the hour 12, and within that, the
minute 47, and within that, the second 13.
USA postal codes (zip codes) are big-endian. 96762 is within the 90000
zone, meaning the western USA. 967 is the state of Hawaii, except Honolulu.
96762 is the town of Laie, within non-Honolulu Hawaii, within the western
USA.
/courses/networking/2011/winter/textbook is an example of a big-endian
file name. File names are generally written in a big-endian notation. “courses”
would be the outer folder, and it includes another folder, “networking,” that
includes another folder, “2011,” that includes another folder, “winter,” that
includes a file, “textbook.”
Scientific dates are big-endian, as in 2011-03-15, where 2011 is the year, and
within that 03 is the month, and within that, 15 is the day. This is handy
for sorting.
Exam Question 16 (p.321): What does little-endian mean? Give an
example.
Acceptable Answer: Little-endian indicates (1) a hierarchical relationship
among parts, (2) with the most precise, specific, narrow end coming first.
The later parts are increasingly more broad, inclusive, and general. Later
parts own or contain the earlier parts. Example: day-month-year.
Geographical locations are often little-endian. In Laie, Hawaii, USA, the
smallest part, Laie, is listed first. It exists within Hawaii, the second part,
which exists within USA, the third part.
European dates are little-endian, as in 15 March 2011, or 15/3/2011, where
2011 is the year, and within that 03 or March is the month, and within that,
15 is the day.
The advantage of little-endian notation is that it is the most easy notation
to shorten when it is relative to some obvious base. Time (basis is now) and
CHAPTER 1. EXPLORING THE WEB 16
As we mentioned above, URLs can also include : and ? and + and # and more
to indicate special things. These act as signposts in finding the meaning of
the URL.
http://en.wikipedia.org/wiki/URI_scheme gives more information about
the various parts of the URL.
Exam Question 19 (p.321): What is syntax?
Acceptable Answer: how we say something
Syntax is the form or format taken by language. It is the “how.”
Communication can be divided into (a) what we mean and (b) how we say
it. What we mean, the meaning, is called semantics. How we say it, the
format or form, is called syntax. Between form and substance, form is
syntax and substance is semantics.
The URL is divided into parts. These parts can be identified by special
characters that act as markers, introducing or separating various pieces.
These markers are part of the syntax of URLs.
Exam Question 20 (p.321): In a URL, where does @ (at) go?
Acceptable Answer: after username, before domain name
The @ is a syntax marker that comes after the username (and password)
and before the domain name. It appears this way in mailto URLs. It also
appears with certain protected web sites.
Exam Question 21 (p.321): In a URL, where does : (colon) go?
Acceptable Answer: three places: (a) after scheme, (b) between username
17
CHAPTER 2. PARTS OF THE URL 18
These codes are used in place of characters that would otherwise have special
meaning, like syntax markers.
Many characters, including syntax markers themselves, have special meaning
in a URL and therefore are not permitted to appear directly as part of a
name or value. These characters are transmitted as percent codes.
When percent codes reach the web server, they are then converted back
to their original form.
Exam Question 28 (p.321): In a URL, where does # (hash) go?
Acceptable Answer: at the end of the URL, right before the fragment id
The # is a syntax marker that introduces the fragment ID. It tells the
browser what part of a web page to jump to.
The fragment is useful in large web pages to jump right to the section of
interest, even if it is in the middle of the page. Specifically it matches an
“id” in the HTML of the web page.
If we say #abc at the end of the URL, and id=’abc’ someplace in the
web page, the browser will try to put that id at the top when the page is
displayed.
A really complicated URL could look something like this.
http://u:[email protected]:8080/path?query=123&x=5#abc
In this example, http is the protocol or scheme, u is the username, p is the
password, example.com is the network location or domain name, 8080 is
the port number, /path is the path, query=123 is the first keyword/value
pair of the query, x=5 is the second keyword/value pair of the query, and
abc is the fragment id.
Chapter 3
Contents
3.1 The Meaning of Internet . . . . . . . . . . . . . . 20
3.2 Local Area Networks . . . . . . . . . . . . . . . . 21
3.3 Routing Between LANs . . . . . . . . . . . . . . . 21
3.4 IP Addresses and Ports . . . . . . . . . . . . . . . 22
3.5 Fundamental Principles . . . . . . . . . . . . . . . 23
The “inter” part of Internet means “among” or “between.” The “net” part
of Internet means “network.” Basically the Internet is a very large collection
of local area networks.
We sometimes discriminate between big-I Internet and little-i internet. With
a big I, it means “the” Internet, meaning the world-wide network of networks
20
CHAPTER 3. HOW THE INTERNET WORKS 21
that connects nearly all computers. With a little i, it means “an” internet:
any other network of networks. A little-i internet might be operated by a
large organization such as a military or a corporation.
Often a little-i internet is called an intranet. The “intra” part of intranet
means “within.”
A computer that belongs to more than one local area network can act as a
router, and can pass messages between those LANs.
The moving of a message from one LAN to an adjacent LAN is called a hop.
CHAPTER 3. HOW THE INTERNET WORKS 22
It is normal for messages to make ten or more hops before they reach their
destination.
The router must send the packet on its next hop toward its ultimate desti-
nation. To do this, each router must belong to two or more LANs.
Routers talk to their neighboring routers. They learn what networks each
one can reach. This enables them to pick the best direction for the next
hop.
Chapter 36 (page 258) goes deeper into routing.
can be between zero and 255. While 255 might seem like a strange limit, it
is the largest number that can be expressed in binary using eight bits.
Based on the IP address of the sender and the receiver, it can be told whether
they are on the same local area network or not.
If they are on the same LAN, the packet can be delivered immediately. If
not, the packet gets sent to a router.
The design of the Internet is quite remarkable. Following are some fun-
damental principles on which that design is based. These principles help
explain why things are as they are.
Probably the number one consideration is survivability. We must survive
hackers and terrorists. We must survive the future improvements of tech-
nology.
Survivability. By this we mean that enemies cannot take it down by
destroying one or two well-placed pieces at the core. Removing a leader
may destroy a small organization, but removing any item from the Internet
must not destroy it.
Exam Question 33 (p.322): What is Survivability?
Acceptable Answer: ability to still function but with reduced perfor-
mance when the network is partly destroyed
Survivability is the ability to continue functioning, perhaps with reduced
performance, if part of the network has been destroyed.
Avoiding Centralization. By this we mean that although there are defi-
nite economies to be had by consolidating power in at the top, this flies in
the face of Survivability. If there is a “top” then we can destroy it and the
rest will die. That must not be allowed.
Exam Question 34 (p.322): Why does the Internet avoid centralization?
Acceptable Answer: improve survivability
Centralization is a threat to survivability.
Local Autonomy. So far as it is possible, each piece of the Internet must be
able to grow at its own pace, and with local direction. Central registration
and central decisions should not be necessary, except rarely.
CHAPTER 3. HOW THE INTERNET WORKS 24
Contents
4.1 The Root Domain . . . . . . . . . . . . . . . . . . 26
4.2 Top Level Domains . . . . . . . . . . . . . . . . . 27
4.3 Second Level Domains . . . . . . . . . . . . . . . 27
4.4 Domain Registrars . . . . . . . . . . . . . . . . . . 28
4.5 Effective Top Level Domains . . . . . . . . . . . . 29
4.6 Sub Domains . . . . . . . . . . . . . . . . . . . . . 29
4.7 The www Sub Domain . . . . . . . . . . . . . . . 30
4.8 DNS Resolution . . . . . . . . . . . . . . . . . . . 30
25
CHAPTER 4. DOMAIN NAMES AND DNS 26
The root level of the domain name system consists of 13* special servers
located around the world. They each contain a small amount of information,
about 1/5 of a megabyte, or 4% of the size of a typical photograph. But that
information leads to all the top level domains in the world. When a new top
level domain is created or moved, which is very rare, the root servers must
be updated.
Having 13 servers helps ensure that the loss of any one of them will not
disable the whole system. It supports the fundamental principle of surviv-
ability.
* http://en.wikipedia.org/wiki/DNS_root has more information about
CHAPTER 4. DOMAIN NAMES AND DNS 27
the root zone of the dns system. It points out that the original 13 servers
have been joined by many more that also serve as roots.
The dot com piece of the domain name is called the Top Level Domain, or
TLD. There are only a few of these. New ones are strictly controlled and
should be rare.
Other common TLDs are edu for schools, org for organizations, net for
networking entities, and the two-letter country codes such as us for the
United States.
http://en.wikipedia.org/wiki/List_of_Internet_top-level_domains
has a complete list of top level domains, including country domains.
Top level domains cannot be purchased. Setting them up can be a very long
and involved political process.
at law.
It is common to pay around $10 per year for a domain name, depending on
the TLD and the registrar.
http://en.wikipedia.org/wiki/Domain_registrars has more on regis-
trars, including links to lists of registrars.
One of the important services provided by the registrar is the associating
of your domain name with the DNS server that you are authorizing and
requesting to give out your IP address when someone wants it.
Otherwise there is danger of identity theft, or domain hijacking, where cus-
tomers to your web site can be directed to a copy-cat site.
Because of such dangers, registrars take great care with DNS issues.
Some second level domains (and lower) are effectively the same as top level
domains. For example, in the United Kingdom, the domain name “.co.uk”
is a second level domain name that is treated a lot like a top level domain
name. It is the UK version of the “.com” top level domain.
Such second (and lower) domain names are called effective top level domains
because new domains can be registered under them.
An effective top level domain is also called a public suffix.
This starts to be important because of web cookies, a method used to
share information between related web sites. Recognizing public suffixes
is an important way to avoid unauthorized sharing of cookie information
between unrelated web sites.
After you acquire a domain at any level, you are generally permitted to
create any number of sub domains. You can use letters and digits and a few
special characters such as the dash (hyphen).
Example: soft.com is a second level domain. micro.soft.com is a third level
domain. It belongs to the soft.com domain.
CHAPTER 4. DOMAIN NAMES AND DNS 30
There are generally no controls over sub domains except that you must first
control the higher level domain.
Example: If I own doncolton.com, I could create pentagon.doncolton.com,
even if I have no association with the Pentagon. Similarly, I could create
citibank.doncolton.com even if I have no association with Citibank Corpo-
ration.
Exam Question 41 (p.322): Is byuh.doncolton.com controlled by BYUH?
Why or why not?
Acceptable Answer: No. Sub domains are controlled by the next higher
domain.
Sub domains may have no relationship to more famous domains or brands
that they look like.
Each sub domain is still a domain, and it can have further sub domains of
its own. So doncolton.com can have the sub domain n101.doncolton.com,
which can have the sub domain testbank.n101.doncolton.com, which can
have a further sub domain.
Often domain names start with www, which stands for World Wide Web.
It is not a requirement, but it is probably the most familiar way to introduce
a URL, instead of saying “http://”.
Example: Instead of saying http://disney.com/, the Walt Disney Company
may find it more desirable to simply say www.disney.com. It is a marketing
thing, and it is very common.
Strictly speaking, www.somedomain.com does not have to lead to the same
web pages as somedomain.com without the www, but practically speaking
they almost always lead the same place.
DNS, the domain name system, is a service that converts domain names
into IP addresses.
Annual fees paid by second level domain holders are used, among other
CHAPTER 4. DOMAIN NAMES AND DNS 31
purposes, to fund the central part of the domain name system. The central
part consists of the root servers.
http://en.wikipedia.org/wiki/Root_servers has more information on
the root servers.
Chapter 33.2 (page 240) discusses the Domain Information Groper, a com-
mand that resolves domain names into IP addresses and tells how the reso-
lution was verified.
Basically the resolution works like this:
The root servers convert the last chunk of a domain name, that is, the top
level domain, into the identity of a machine.
That machine converts the next chunk into the identity of another machine.
The process is recursive. By that we mean it continues until the last chunk
is converted, giving the identity of the final machine.
For example, n101.doncolton.com is resolved by checking the root server.
It returns the IP address for the .com DNS server. The .com server re-
turns the IP address for doncolton.com, which returns the IP address for
n101.doncolton.com.
We will talk much more about IP addresses, starting in chapter 27 (page
179) below.
Chapter 5
Contents
5.1 Host . . . . . . . . . . . . . . . . . . . . . . . . . . 32
5.2 Configuration . . . . . . . . . . . . . . . . . . . . . 33
5.3 Dynamic v Static . . . . . . . . . . . . . . . . . . 33
5.4 Typical Scenarios . . . . . . . . . . . . . . . . . . 34
Before a computer can use the Internet, it needs a few things. It needs to
have an IP address. It needs to know the gateway (router) that can forward
messages beyond the local area network. It needs to know the location of
certain services, such as DNS. DHCP is generally used by computers to
find out these configuration details when they first boot up.
The requesting computer will make a DHCP request by way of a general
broadcast asking for configuration information.
Exam Question 42 (p.322): What does DHCP stand for?
Required Answer: dynamic host configuration protocol
5.1 Host
32
CHAPTER 5. DHCP: HOST CONFIGURATION 33
5.2 Configuration
In the early days, computers were few and big and did not move. It was
practical to assign these addresses by hand.
With the advent of laptop computers and other portable devices, and further
driven by large collections of end-user computer workstations, configuration
by hand has become very unpopular and most configuration is automated.
For servers, this configuration information is often hard coded, by which
we mean that someone actually typed it in and saved it on that computer.
When the computer first turns on, it checks for the information. If it finds
it, it is happy and life moves forward.
For most other computers, and especially for portable computers like lap-
tops and tablets, this information changes depending on what networks are
nearby. The computer has to ask for the information. This asking is done
by way of a DHCP request.
In effect, the computer asks “Please tell me my name and where I can find
the front door.” Or, more accurately, please tell me my IP address, net
mask, local gateway, and location of the DNS servers I should use.
Exam Question 47 (p.323): What does DHCP provide? Include a specific
example.
Acceptable Answer: (a) DHCP provides parameters necessary to use the
network. (b) Specific examples include IP address, net mask, gateway,
and DNS servers.
Exam Question 48 (p.323): How does a typical laptop computer discover
its own IP address?
Acceptable Answer: dhcp
Exam Question 49 (p.323): How does a typical server computer discover
its own IP address?
Acceptable Answer: Server IP addresses are normally static. The IP
address is stored within the server. It does not have to ask for it.
Servers have static IP addresses to prevent accidental changes. If the IP ad-
dress of a server is changed, then the DNS must also be updated to properly
direct requests for its services.
DHCP can be configured to always give the same IP address to certain
machines, based on their MAC addresses.
Unit II
OSI Model
35
Chapter 6
Contents
6.1 Open Standards . . . . . . . . . . . . . . . . . . . 37
6.2 Seven Layers of the Stack . . . . . . . . . . . . . 37
6.3 OSI Layer 7: The Application Layer . . . . . . . 38
6.4 OSI Layer 6: The Presentation Layer . . . . . . 38
6.5 OSI Layer 5: The Session Layer . . . . . . . . . . 39
6.6 OSI Layer 4: The Transport Layer . . . . . . . . 39
6.7 OSI Layer 3: The Network Layer . . . . . . . . . 41
6.8 OSI Layer 2: The Data Link Layer . . . . . . . . 42
6.9 OSI Layer 1: The Physical Layer . . . . . . . . . 44
The OSI networking model is the standard way of thinking about and talk-
ing about the different layers that make up the Internet.
Each layer has specific duties. By keeping things in separate layers, changes
and upgrades are more easily made. Better local area networking can be
implemented without redesigning the whole Internet.
This is a good thing.
Students should be able to apply the OSI model to networking hardware
and software. Mostly we are concerned with the bottom four layers.
http://en.wikipedia.org/wiki/OSI_model has more.
36
CHAPTER 6. THE OSI MODEL 37
Skill: Know, by number and by name, the seven layers of the OSI model.
Application Presentation Session Transport Network Datalink Physical
There are phrases (called mnemonics) that can be used to remember the
order of the layers. You can make up your own. Or pick one of these
phrases and use the first letter of each word to remind yourself of the OSI
layer that starts with the same letter. Here is the most popular phrase I
have encountered.
a p s t n d p :: All People Seem To Need Data Processing
http://en.wikipedia.org/wiki/List_of_mnemonics has several listed
under Computing.
As data flows down the stack, this layer divides the data up into segments.
The maximum size of a segment is normally 1500 characters. It is called the
MTU, or Maximum Transmission Unit. The segments are numbered and
sent on down the stack, one by one. As data flows up the stack, this layer
collects the segments that have arrived and places them in order. When all
the segments have been received, it passes the assembled data chunk up the
stack to layer 5.
Exam Question 60 (p.323): What does MTU stand for?
Acceptable Answer: maximum transmission unit
MTU is the number of bytes of data that can be sent in a single packet.
Normally this number is 1500. If you try to send more at once, TCP will
break it up into smaller pieces to stay within the MTU requirements.
Exam Question 61 (p.323): What is the typical value for MTU (in bytes)?
Acceptable Answer: 1500
TCP and UDP also define the rules for ports on your computer. Ports
help to separate the network traffic that is coming to your computer. This
is important because computers are required to be able to carry on sev-
eral conversations at the same time. Ports help to keep the conversations
separate.
Exam Question 62 (p.323): At which OSI layer are software ports?
Required Answer: 4 or transport
Exam Question 63 (p.324): What does TCP stand for?
Required Answer: transmission control protocol
Exam Question 64 (p.324): Which protocol provides for guaranteed de-
livery of information?
Required Answer: tcp
TCP, the Transmission Control Protocol, provides guaranteed delivery through
retransmission as needed.
Exam Question 65 (p.324): At which OSI layer is TCP?
Required Answer: 4 or transport
TCP is suitable for file transmission where accuracy is more important than
avoiding delays.
http://en.wikipedia.org/wiki/Transmission_Control_Protocol has
CHAPTER 6. THE OSI MODEL 41
Layer 3 is the network layer. It defines the rules for wide area networks.
Usually this is the Internet, or some piece of it involving many computers.
For the Internet, this always relies on IP addresses. Routers and gateways
operate at this level.
Layer 3 is sometimes called the Internet layer.
Required Answer: 3
Exam Question 73 (p.324): At which OSI layer is the Internet?
Required Answer: 3 or network
Exam Question 74 (p.324): At which OSI layer are Wide Area Networks?
Required Answer: 3 or network
Exam Question 75 (p.324): What does WAN stand for?
Required Answer: wide area network
Exam Question 76 (p.324): At which OSI layer is IP Addressing?
Required Answer: 3 or network
Exam Question 77 (p.324): In networking, what does IP stand for?
Required Answer: internet protocol
Exam Question 78 (p.324): At which OSI layer is Logical Addressing?
Required Answer: 3 or network
Exam Question 79 (p.324): At which OSI layer does a router operate?
Required Answer: 3 or network
Exam Question 80 (p.324): At which OSI layer does a gateway operate?
Required Answer: 3 or network
Exam Question 81 (p.324): At which OSI layer is Network Address Trans-
lation?
Required Answer: 3 or network
Exam Question 82 (p.324): At which OSI layer is Port Address Transla-
tion?
Required Answer: 3 or network
Exam Question 83 (p.324): At which OSI layer do we find packets?
Required Answer: 3 or network
Exam Question 84 (p.324): What is the Protocol Data Unit at OSI layer
3?
Required Answer: packet
Layer 2 is the data link layer. It defines the rules for local area networks.
Typically this is Ethernet and relies on MAC addresses. Switches and
CHAPTER 6. THE OSI MODEL 43
Skill: Know which common networking items match layer 2: Data Link.
Exam Question 85 (p.324): What is layer 2 of the OSI model?
Required Answer: datalink
Exam Question 86 (p.325): What layer number is the Data Link layer of
the OSI model?
Required Answer: 2
Exam Question 87 (p.325): What does MAC stand for?
Required Answer: media access control
Exam Question 88 (p.325): How does a typical laptop computer discover
its own MAC address?
Acceptable Answer: it is burned in on the network card
The network card is called a NIC, or Network Interface Controller.
Exam Question 89 (p.325): What does NIC stand for?
Acceptable Answer: network interface controller
Exam Question 90 (p.325): At which OSI layer is the Local Area Net-
work?
Required Answer: 2 or datalink
Exam Question 91 (p.325): At which OSI layer is MAC Addressing?
Required Answer: 2 or datalink
Exam Question 92 (p.325): At which OSI layer is Physical Addressing?
Required Answer: 2 or datalink
Exam Question 93 (p.325): At which OSI layer is Ethernet?
Required Answer: 2 or datalink
Exam Question 94 (p.325): At which OSI layer does a switch operate?
Required Answer: 2 or datalink
Exam Question 95 (p.325): At which OSI layer does a bridge operate?
Required Answer: 2 or datalink
Exam Question 96 (p.325): What is a multi-port bridge called?
Required Answer: switch
Exam Question 97 (p.325): What is a two-port switch called?
CHAPTER 6. THE OSI MODEL 44
operate?
Required Answer: 1 or physical
Exam Question 110 (p.326): At which OSI layer do we find bits?
Required Answer: 1 or physical
Exam Question 111 (p.326): What is the Protocol Data Unit at OSI layer
1?
Required Answer: bit
Chapter 7
IP Addressing Preview
Contents
7.1 Routers Use IP Addresses . . . . . . . . . . . . . 46
7.2 What Does an IP Address Look Like? . . . . . . 47
7.3 Networks and Hosts . . . . . . . . . . . . . . . . . 47
7.4 Local Area Networks . . . . . . . . . . . . . . . . 48
7.5 Ports Lead to Programs . . . . . . . . . . . . . . 48
46
CHAPTER 7. IP ADDRESSING PREVIEW 47
Each IP address can be broken into two pieces. The first piece is the network
and the second piece is the host.
CHAPTER 7. IP ADDRESSING PREVIEW 48
In the case of 192.168.0.100, the network is 192.168.0 and the host is 100.
The break does not always come right before the last number. The rules
can be complicated. We talk about them in chapter 27 (page 179).
All machines in the same local area network have the same network number,
but each machine has a different host number.
All the computers that are close to you are considered to be in your Local
Area Network. We use the abbreviation LAN for Local Area Network.
Local computers are the ones that are close enough that you can talk to
them directly.
Other computers are far away enough that you cannot talk to them directly.
In that case, you have to send your message by way of a Router. The
Router passes along the message, and when a response comes, it returns the
response to you.
All computers in the same LAN have IP addresses that look very similar.
If your IP address is 192.168.0.100, then the other computers in your LAN
will have 192.168.0.x for their IP address, where x can be any other number
between 1 and 254.
Why not zero to 255? Good question. Essentially it is because the first and
last address are reserved for special purposes. Zero is the network itself. 255
is called the (default) broadcast address. If you want to send a message to
everyone on your local area network, you could send it to 192.168.0.255.
As we said above, we cover IP addresses in much more depth in chapter 27
(page 179).
In effect, when the computer starts up, it also starts up a bunch of programs.
Some of those are willing to receive messages. Those programs tell the
computer, hey, if you get a message for port 123, send it to me.
Each program on that computer, if it wants to receive messages, has a port
number.
Exam Question 112 (p.326): What is a software port?
Acceptable Answer: A port is a number that indicates which computer
program should receive the message.
Chapter 8
Contents
8.1 2→8: Convert Binary to Octal . . . . . . . . . . 51
8.2 2→16: Convert Binary to Hex . . . . . . . . . . . 51
8.3 8→2: Convert Octal to Binary . . . . . . . . . . 52
8.4 16→2: Convert Hex to Binary . . . . . . . . . . . 53
8.5 10→2: Convert Decimal to Binary . . . . . . . . 53
8.6 2→10: Convert Binary to Decimal . . . . . . . . 54
50
CHAPTER 8. CONVERTING BETWEEN BASES 51
To convert binary to octal, first divide the number into groups of three
bits, starting at the back.
1011001010001 becomes 1 011 001 010 001.
Next convert each group into an octal digit. Leading zeroes (zeroes at the
front of a number) do not matter, except for deciding where to divide into
groups. The last digit is worth 1. The digit before it is worth 2. The digit
before it is worth 4. Each digit is worth twice as much as the one that comes
next.
1 011 001 010 001 becomes 13121.
binary 3-bit binary octal
0 000 0
1 001 1
10 010 2
11 011 3
100 100 4
101 101 5
110 110 6
111 111 7
Exam Question 113 (p.326): Convert binary 11110100010000 to octal.
Acceptable Answer: 36420
To convert binary to hex, first divide the number into groups of four bits,
starting at the back.
1011001011001 becomes 1 0110 0101 1001.
Next convert each group into a hex digit. Zeroes at the front of a number
are called leading zeroes and do not affect the value of the number. The
last digit is worth 1. The digit before it is worth 2. The digit before it is
worth 4. The digit before it is worth 8. Each digit is worth twice as much
as the one that comes next.
1 0110 0101 1001 becomes 1659.
CHAPTER 8. CONVERTING BETWEEN BASES 52
To convert octal to binary, just convert each digit, one by one. You can
start at the front or the back. It does not matter.
Make sure you use three bits per octal digit.
13121 becomes 001 011 001 010 001.
Finally, remove the leading zeroes and close up the spaces.
001 011 001 010 001 becomes 1011001010001.
Exam Question 115 (p.326): Convert octal 16471 to binary.
Acceptable Answer: 1110100111001
CHAPTER 8. CONVERTING BETWEEN BASES 53
To convert hex to binary, just convert each digit, one by one. You can
start at the front or the back. It does not matter.
Make sure you use four bits per hex digit.
1659 becomes 0001 0110 0101 1001.
Finally, remove the leading zeroes and close up the spaces.
0001 0110 0101 1001 becomes 1011001011001.
Exam Question 116 (p.326): Convert hex 64209 to binary.
Acceptable Answer: 1100100001000001001
5,00010
,10100010 is our final answer.
The Other Way: Here is the most popular other method.
Make a list of powers of two until you surpass the number you are converting.
162 is our starting point, so the powers would be these:
1, 2, 4, 8, 16, 32, 64, 128, 256.
We can stop with 256 because it is greater than 162.
Reverse the list (or write the list in this order to begin with):
256, 128, 64, 32, 16, 8, 4, 2, 1.
Now, subtract the largest power of two possible from 162. The largest one
is 128. 162 - 128 = 34.
Repeat the process: 34 - 32 = 2. 2 - 2 = 0.
For each number you subtracted, you get a 1. For each number you skipped,
you get a zero.
256=0, 128=1, 64=0, 32=1, 16=0, 8=0, 4=0, 2=1, 1=0.
Collect the ones and zeroes:
010100010
Throw away the leading zero:
10100010 is our final answer.
Both methods are guaranteed to work.
We will write the base 10 number to the left of the comma, and the remaining
base 2 number to the right of the comma. We start with nothing. At
each step, we double the base 10 number and add in the next binary digit.
(Special thanks to my student Zhiwei Hou for demonstrating this notation,
which I see as an improvement over the notation I was using before.)
0,10001000 is our starting point.
1,0001000 : double 0, add 1, = 1.
2,001000 : double 1, add 0, = 2.
4,01000
8,1000 : we will double 8 and add 1 giving 17.
17,000 : we will double 17 and add 0 giving 34.
34,00
68,0
136, we have arrived at our final answer.
For a short-cut, you can immediately convert as many digits from the front
as you happen to have memorized. Say you know that 1000 is 8. Then you
can remove the 1000 and start with 8.
8,1000 is our starting position.
17,000 : we will double 17 and add 0 giving 34
34,00
68,0
136, we have arrived at our final answer.
The Other Way: Here is the most popular other method.
10001000 is our starting point.
Make a list of powers of two.
256, 128, 64, 32, 16, 8, 4, 2, 1.
Assign the bits to the powers, starting at the little end.
256, 128=1, 64=0, 32=0, 16=0, 8=1, 4=0, 2=0, 1=0.
Keep the numbers that got ones assigned to them.
128=1, 8=1.
Add them up. 128 + 8 = 136.
We have arrived at our final answer.
Chapter 9
Anatomy of a Hop
Contents
9.1 Down the Stack . . . . . . . . . . . . . . . . . . . 57
9.2 Encapsulation . . . . . . . . . . . . . . . . . . . . . 58
9.3 Up the Stack . . . . . . . . . . . . . . . . . . . . . 58
9.4 Routers and Hops . . . . . . . . . . . . . . . . . . 59
9.5 To Infinity and Beyond . . . . . . . . . . . . . . . 59
9.6 Trace Route . . . . . . . . . . . . . . . . . . . . . . 61
With your knowledge of the OSI model and of IP addresses, we can explain
in greater detail how information moves across the Internet.
Looking at all this, it may seem like a miracle that it ever worked. I am
sure many people felt that way when they first got it going.
You will probably notice that some layers did a lot of work, while others
seem to do little or nothing. Mostly that is because we have simplified it
greatly, just keeping the parts we think you need to know.
Each layer has a fairly straightforward set of responsibilities. By breaking
them up using the OSI model, the program for each layer was kept as simple
as possible, thus making it easier to write and debug. In general, this is a
good approach to software development.
In the following sections, we will look in detail at how data moves through
the network. Another interesting view of this is given in section 25.6 (page
169), where we examine a hacking legend, the Ping of death, that relies
on the stack to do its dirty work.
56
CHAPTER 9. ANATOMY OF A HOP 57
9.2 Encapsulation
By the time we reach layer 1, we have the following basic data structure.
frame header (20 bytes, including MAC addresses)
packet header (20 bytes, including IP addresses)
segment header (20 bytes, including ports)
segment data (up to 1500 bytes).
If the ultimate destination is in the same local area network, we are ready
to push it back up the stack. If not, we have routers and hops in front of
us. But let’s skip that for the moment and pretend we have reached the
ultimate destination.
Layer 1 is the physical layer. It receives the bits one by one from across
the local area network. When it has a complete frame, it hands it up the
stack to layer 2.
Layer 2 is the data link layer. It verifies the header on the frame and
removes it, revealing the packet. Then it hands it to layer 3.
Layer 3 is the network layer. It verifies the header on the packet and
removes it, revealing a segment. Then it hands it to layer 4.
Layer 4 is the transport layer. Again, it has to do some serious work.
It looks at the offset and length of each segment. It removes the segment
headers and reassembles the segment data in a buffer. With TCP it replies
to the sender so the sender will know which segments are still missing. When
the data is complete, it hands it up the stack to layer 5.
Layer 5 is the session layer. It pretty much just hands the data up the
stack to layer 6.
Layer 6 is the presentation layer. It converts the data from network en-
coding into the local coding on the receiving computer. It also reverses any
encryption that was done. It also reverses any data compression that was
done. Then it hands the data up the stack to layer 7.
Layer 7 is the application layer. It places the data where the application
program can get it and notifies the application program that the data is
available.
CHAPTER 9. ANATOMY OF A HOP 59
The simple case we have examined above passes the data down the stack,
across the local area network, and back up the stack, from one computer to
another.
In many cases the computers do not share the same local area network. We
must enlist the aid of routers that will help the data along its way.
Each router stands at the intersection of two (or more) local area networks.
It belongs to both networks.
Chapter 36 (page 258) goes deeper into routing.
Local area networks exist at OSI layer 2. Routers exist at OSI layer 3. If
the router is not the ultimate destination for the data, it performs a hop,
moving the data from one local area network to the next one.
Data will pass through the following layers: 1, 2, 3, 2, 1.
The data passes up through layers 1 and 2 as always.
The activity at layer 3 is different.
Layer 3 is the network layer. The router extracts the destination IP address.
It consults its routing tables to pick a path that will take it closer to its
destination. Then it passes it back down to layer 2 with a new intermediate
destination.
The data passes back down through layers 2 and 1 as always.
This 1, 2, 3, 2, 1 action is called a hop.
Exam Question 119 (p.326): What is a hop?
Acceptable Answer: moving a packet from one lan to the next lan
A hop is the activity performed by a router when it receives a packet on one
local area network, and passes it across to a different local area network,
one step closer to its final destination.
router that dropped the packet sends a death notice back to the originator.
The death notice simply says that the packet died, and where it died.
If a death-notice packet dies, it just dies. Nobody gets told about it.
Chapter 36 (page 258) goes deeper into routing.
By manipulating the TTL values in packets, we can find the route that
they are taking through the Internet. This is the approach used by the
traceroute command, also called tracert.
Trace route sends the first packet with a TTL of 1. That packet reaches the
first router where the TTL is reduced by one and becomes zero. The packet
dies. The first router sends the death notice back. Trace route reports the
location of death. It is the first hop in the route.
Trace route sends another packet. This one has a TTL of 2. That packet
reaches the first router where the TTL is reduced by one and becomes 1. It
continues forward to the second router where the TTL becomes zero. The
packet dies. The second router sends the death notice back. Trace route
reports the location of death. It is the second hop in the route.
By gradually running up the numbers, trace route can feel out the entire
route that the packet will take. It can report all this information to the
technician that is watching.
See section 32.1 (page 233) for more on trace route.
Chapter 10
Contents
10.1 Network Address Translation Model . . . . . . . 64
10.2 Man In The Middle . . . . . . . . . . . . . . . . . 64
10.3 Faking Out the Interior Computer . . . . . . . . 65
10.4 Faking Out the Destination Computer . . . . . . 65
10.5 Remembering the Lies . . . . . . . . . . . . . . . 65
10.6 Time Out . . . . . . . . . . . . . . . . . . . . . . . 67
10.7 Be The Router . . . . . . . . . . . . . . . . . . . . 68
The IPv4 address space is running out. Within organizations and in homes,
the number of outward facing computers with routable IP addresses is lim-
ited.
http://en.wikipedia.org/wiki/Network_address_translation has more
on NAT.
Exam Question 122 (p.327): What does having a routable address mean?
Acceptable Answer: packets can be sent to your IP address across the
Internet
Exam Question 123 (p.327): What does having a non-routable address
mean?
Acceptable Answer: packets can be sent to your IP address across your
LAN, but the Internet requires NAT.
Routable refers to an IP address. Those addresses that are officially usable
62
CHAPTER 10. ADDRESS SHARING (NAT) 63
as sources and destinations must start with a number between 1 and 223,
with certain addresses reserved (not routable).
If you have a non-routable address, you can receive packets across your local
area network, or perhaps across your corporate network, but not across the
full Internet.
If you have a non-routable address, you share the routable address of some-
one else that will receive the packet on your behalf. They use NAT to send
the packet along to you.
Exam Question 124 (p.327): List in any order the five non-routable IP
address blocks
Required Answer: 10.0.0.0/8, 127.0.0.0/8, 169.254.0.0/16, 172.16.0.0/12,
192.168.0.0/16
Network Address Translation, NAT, has been used since the 1990s as a
partial solution to this problem. Because it is in place, it is also being used
to solve other problems.
Exam Question 125 (p.327): What does NAT stand for?
Required Answer: network address translation
Exam Question 126 (p.327): What does PAT stand for?
Required Answer: port address translation
PAT is another name for Network Address Translation. NAT is the generally
used terminology.
For comparison, look at regular postal mail. In the USA, postal mail is often
delivered directly to a home or to a post office box. Although it is possible
for each person living at that home to have their own, personal mail box, it
is far more common to have one mail box that covers everyone. The address
is shared.
In networking, for requests and replies to be transmitted across the Internet,
both the sender and the receiver must have a valid IP address.
Since the addresses are becoming scarce, ISPs charge extra for each addi-
tional IP address. It has become common to share IP addresses within an
organization or a home.
CHAPTER 10. ADDRESS SHARING (NAT) 64
not just listening in. It is actively passing the messages along. It could
choose to drop messages, change them, or create false messages.
NAT changes messages in well-accepted ways but does not drop them or
create false messages. NAT is legitimate. The router is in the middle, but
everyone is happy. NAT is not a man in the middle attack.
For this to work the interior computer has to send its messages to the router.
No problem there. This will happen anyway.
Because we do not have enough routable IP addresses to go around, the
router fakes out the interior computer by giving it a non-routable address,
like 192.168.0.100. Other interior computers (there could be many) also
have their own non-routable addresses.
The router hands out these non-routable addresses as part of its task of
providing DHCP services to the local area network.
When an out-bound packet arrives at the router, he plays his man in the
middle role and updates the packet to make it appear that it is coming from
him instead of the interior computer.
This is called network address translation.
The message is then forwarded to the destination computer which processes
it as though the router were the true sender.
A reply is then sent back to the router.
The router then modifies the reply so it can continue on to its true destina-
tion, the interior computer.
The trick about telling lies is that you have to remember what you told
people. In this case, the router has to remember which interior computer is
CHAPTER 10. ADDRESS SHARING (NAT) 66
The router does not have infinite memory. Eventually the address pool table
will fill up. Something will have to be thrown away.
The router does this by using a ten-minute timeout. (The exact time limit
may vary from router to router.)
Each time an entry is used, its count-down timer is reset to ten minutes.
When a timer reaches zero, that entry gets deleted. The interior computer
is not active, or the browser has been closed. The space can be freed up for
other computers.
This is called garbage collection.
Exam Question 130 (p.327): What is garbage collection?
Acceptable Answer: reclaiming resources that are no longer in use
Notice that you are not reclaiming “data.” You are, instead, reclaiming the
storage space that was being used by the data.
After collection, the resources can be recycled and used for something else.
If an entry is needed but the address pool is full, the entry closest to timing
out can be deleted.
Exam Question 131 (p.327): How long do NAT address pool entries last?
Acceptable Answer: (a) ten minutes of inactivity, or (b) if table is full
the longest inactive expires
Time-out expiration and garbage collection can cause problems.
True Example: An interior computer can be connected to a server some-
where. Maybe the connection is by way of SSH. If the end user walks away
from their computer, the connection becomes quiet. Eventually the connec-
tion is dropped from the NAT table. But the connection is still alive so far
as the server is concerned.
What to watch for: If you are experiencing timeouts, and if it seems to
happen exactly ten minutes after you went idle, then maybe this is the
problem.
How to avoid problems: You can often arrange to send a keep-alive message
every five minutes or so. This keeps the connection from timing out and
CHAPTER 10. ADDRESS SHARING (NAT) 68
being dropped.
Exam Question 132 (p.327): What is a keep-alive?
Acceptable Answer: A message sent between two computers just to keep
the connection from timing out and being dropped.
Keep-alive messages reset the timeout value. This prevents having the con-
nection closed before you are ready.
Each keep-alive also reassures each machine that the other machine is still
up and running and interested in continuing the conversation.
Contents
11.1 What is a Client? . . . . . . . . . . . . . . . . . . 69
11.2 Peer to Peer . . . . . . . . . . . . . . . . . . . . . 70
11.3 Hidden Computers . . . . . . . . . . . . . . . . . 70
11.4 Hidden Peers . . . . . . . . . . . . . . . . . . . . . 71
11.5 Port Forwarding and DMZ . . . . . . . . . . . . . 71
11.6 Hosted Connections . . . . . . . . . . . . . . . . . 72
11.7 Brokered Connections . . . . . . . . . . . . . . . . 73
When you sit down at a computer and start up a browser, your computer
is acting as a client. It is making requests to other computers that act as
servers.
We use the word client to describe a computer that mostly makes requests.
We use the word server to describe a computer that mostly responds to
requests.
69
CHAPTER 11. PEER TO PEER WITH NAT 70
Strictly speaking, every computer does both. Every client computer also has
moments when it must act as a server. Otherwise it will be dropped from
the network. It must answer certain kinds of requests, like “do you exist?”
No answer means someone else may be assigned your IP address since you
do not seem to be using it anymore.
For any two computers to talk to each other across the Internet, each must
have a routable address.
Let us invent some terms we can use in this discussion.
“visible” means a computer that has a routable address.
“hidden” means a computer that does not have a routable address. Instead
it has a non-routable address such as 192.168.x.x.
“NAT proxy” means a computer that gives hidden computers (its clients)
access to the Internet. The NAT proxy shares its IPv4 address with its
clients by providing Network Address Translation. It keeps track of things
CHAPTER 11. PEER TO PEER WITH NAT 71
The first solution to un-hiding a peer is to have its NAT proxy poke a
permanent hole in the firewall. This is done by identifying a specific port
number at the firewall and having all traffic for that port automatically
forwarded to the hidden computer.
This only has to be done by one client, which then becomes the “server” for
all the other clients.
This works but there are several problems with it.
(a) The hidden computer operator must get the NAT proxy operator to
CHAPTER 11. PEER TO PEER WITH NAT 72
open up the hole in the firewall. This is beyond the technical skills of many
home users.
(b) Only one hidden computer can own a given specific port. That may
work okay when the connection is for hosting a game and nobody else in the
family is likely to want to host at the same time, but it’s not so great if the
connection is for video chat.
Setting up DMZ is easier than setting up port forwarding, but has similar
problems.
DMZ stands for demilitarized zone. Demilitarized zone suggests that the
place has no military to protect it. In our case, it is not protected by the
router or its firewall.
Exam Question 133 (p.327): What does DMZ stand for?
Acceptable Answer: demilitarized zone
Port forwarding can be set up with triggers, but it’s still tricky.
These methods are really a last resort. They work but they are difficult to
set up and use.
Both peers can talk to a broker. The broker is a visible computer whose
purpose is to get peers talking to each other.
Both peers must initiate a conversation with the broker. This creates the
small holes in the firewalls. The broker can then share those holes with the
peers, and the peers can reach each other directly after that.
So far as setting up goes, this is just like the MITM scenario provided
above. But the MITM does not host the connection after the conversation
gets started, so the load on the MITM is much smaller. This makes it easier
for low-budget and open source projects to provide brokers.
This kind of connection is used for things like skype.
Unit III
Home Networking
74
Chapter 12
Contents
12.1 ISP . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
12.2 DeMarc . . . . . . . . . . . . . . . . . . . . . . . . 77
12.3 Modem . . . . . . . . . . . . . . . . . . . . . . . . . 77
12.4 UTP Cable or Wire . . . . . . . . . . . . . . . . . 79
12.5 Computer . . . . . . . . . . . . . . . . . . . . . . . 80
One of our target objectives is that you be able to correctly set up a home
network. Let’s start by introducing (or reviewing) about the components
you will need.
Skill: Know the components of a home Internet system. Know their names.
For each name, be able to describe what it is and what it does.
The components of a home Internet system are generally items like these:
12.1 ISP
There is a cable or phone line coming in from the ISP (Internet Service
Provider) that connects you to the Internet. You typically pay a monthly
fee (in 2010 in the USA it is often around $50) in return for this service.
Typically this is the slowest part of your network. Without it, you are not
75
CHAPTER 12. HOME NETWORK COMPONENTS 76
on the Internet.
Exam Question 134 (p.327): What does ISP stand for?
Required Answer: internet service provider
http://netindex.com/ has speed statistics.
http://www.netindex.com/ is a good source of statistics for upload and
download speeds throughout the world.
Typical download speeds range from around 12 Mb/s to 20 Mb/s.
Mb/s means megabits per second. It is also written Mbps. The “b” is
small to indicate bits. If we said MB/s that would mean megabytes per
second.
Exam Question 135 (p.327): What is a typical broadband download speed
in megabits per second (2013, Worldwide)?
Acceptable Answer: 15
Typical upload speeds range from around 4 Mb/s to 7 Mb/s.
Exam Question 136 (p.328): What is a typical broadband upload speed
in megabits per second (2013, Worldwide)?
Acceptable Answer: 5
Exam Question 137 (p.328): What is bandwidth?
Acceptable Answer: bits transmitted per second
Bandwidth measures how many bits per second can be transmitted. Band-
width is important to downloading files and viewing web pages.
Exam Question 138 (p.328): What is throughput?
Acceptable Answer: bits transmitted per second
Throughput measures how many bits per second can be transmitted. Band-
width and throughput mean the same thing. Bandwidth is the more com-
monly used term.
Exam Question 139 (p.328): List in either order the two measures of
network speed.
Acceptable Answer: bandwidth, latency
Exam Question 140 (p.328): List in any order the three measures of
network speed.
Acceptable Answer: upload bandwidth, download bandwidth, latency
For consumers, download bandwidth and upload bandwidth are often dif-
CHAPTER 12. HOME NETWORK COMPONENTS 77
ferent. It can take a long time to upload a picture, for instance, as part of
sending an email, but a much shorter time to download it when receiving
that email.
Exam Question 141 (p.328): What is latency?
Acceptable Answer: time between sending and receiving a packet
Latency is also called ping time or lag. Latency is especially important to
gamers.
In the home market, typically an ISP is a cable TV company or a telephone
company. Satellite companies also provide Internet.
12.2 DeMarc
12.3 Modem
Frequencies: Within the wide area network provided by DSL or cable, the
information is in the form of frequencies on the wires. Frequencies are related
to modulation, and are a better way to send information long distances.
Modulation: Ordinary radios use frequency modulation to send sounds
great distances. AM radio uses Amplitude Modulation. FM radio uses
Frequency Modulation.
There are two kinds of cable that we have mentioned. One is on the ISP
side. It is typically coaxial cable and is used to connect your cable modem
to the Internet.
The other is on the LAN side. It is typically Ethernet cable which is
usually UTP cable. UTP stands for Unshielded Twisted Pair. It is also
referred to as Cat 5 cable (or similar words). It is the cable that you use to
connect computers to routers and switches and gateways inside your house.
UTP cable uses eight-bladed modular connectors, properly called 8P8C,
and commonly called RJ45, that clip into physical ports on computers and
routers.
Exam Question 147 (p.328): What does 8P8C stand for?
Acceptable Answer: eight position eight contact
Exam Question 148 (p.328): In RJ45, what does RJ stand for?
Required Answer: registered jack
The RJ series of jacks is standardized by the US FCC (Federal Communi-
cations Commission).
12.5 Computer
to bring in someone from the ISP, they will want your computer to be
directly connected to their modem. That removes issues caused by your
network. If they can determine that their connection works well to your
single computer, without router or anything else, then they will conclude it
is not their problem.
Before calling them, you should make that test yourself. Connect your
computer directly to the modem. Can you get Internet? If not, then call
the ISP. But if you can get Internet, then you need to debug your home
network.
Exam Question 155 (p.328): What two times should you connect your
computer directly to a modem?
Acceptable Answer: (a) when it is the only computer on your home
network. (b) when you are troubleshooting the network.
Even if you only have one computer, it is still worth while to have a router
for its firewall benefits.
Chapter 13
Home Router
Contents
13.1 Router . . . . . . . . . . . . . . . . . . . . . . . . . 82
13.2 Wi-Fi / WAP . . . . . . . . . . . . . . . . . . . . . 83
13.3 Switch . . . . . . . . . . . . . . . . . . . . . . . . . 86
13.4 Computers / Hosts . . . . . . . . . . . . . . . . . 86
13.5 Wiring . . . . . . . . . . . . . . . . . . . . . . . . . 87
13.1 Router
First, the Router acts as a firewall to prevent hackers from reaching your
computers.
Second, it also acts as a gateway between the Internet and the LAN (local
area network) inside your home or business.
82
CHAPTER 13. HOME ROUTER 83
802.11n Wi-Fi tops out at 150 Mb/s per stream, with up to four stream for
a total of 600 Mb/s. It was adopted as a standard in 2009, and is currently
(2013) the popular standard. It uses both the 2.4 GHz and 5 GHz bands,
and multiple data streams. Its range is about double that of a/b/g. Because
the Wi-Fi is usually backwards-compatible with the 11b and 11g standards,
it is often advertised as 802.11b/g/n.
802.11ac This is the newly emerging standard. Because the Wi-Fi is usually
backwards-compatible with the 11b and 11g standards, it is often advertised
as 802.11b/g/n/ac. But because b/g/n/ac is getting pretty long, you may
see it as just 802.11ac and you will find the rest listed in the fine print.
Wi-Fi bandwidth is shared among all users.
Exam Question 167 (p.329): How many connections can a Wi-Fi access
point handle?
Acceptable Answer: 20+
The theoretical limit is hundreds or even thousands. The usable number is
probably more around 20. The practical limit depends on how chatty each
device will be. It is a bandwidth problem instead of a number of connections
problem.
Some places configure their WAPs to limit the number of connections, ap-
parently in hopes of keeping the bandwidth from being spread too thin.
This can be deceptive, however. Someone wandering through your area
may snatch up one of your connection slots and it may remain allocated to
them even after they have left the area, thus denying service to a new person
entering the area.
Exam Question 168 (p.329): How fast (in Mb/s) is a wired connection?
Acceptable Answer: 100 is common
10 Mb/s is the old standard. It is called Ethernet. It normally requires cat3
cable or better.
100 Mb/s is very common. It is called Fast Ethernet. It normally requires
cat5 cable or better.
1000 Mb/s is becoming common. It is called gigabit Ethernet. It normally
requires cat6 cable or better.
Exam Question 169 (p.329): What is duplex (in general)?
Acceptable Answer: Duplex tells whether you have two paths, in and
CHAPTER 13. HOME ROUTER 86
13.3 Switch
Home Routers normally support about four local (wired) connections, plus
a large number of Wi-Fi (wireless) connections. Each connection can han-
dle one device, such as a computer, a printer, a Blu-Ray player, a gaming
console, or a security system. If you need more than four wired connections,
you need to get another Router or a Switch.
Exam Question 172 (p.329): What benefits does a switch provide?
Acceptable Answer: (a) more wired ports. (b) full-duplex communica-
tion.
13.5 Wiring
Contents
14.1 Selecting the Pieces . . . . . . . . . . . . . . . . . 88
14.1.1 Pick Your ISP . . . . . . . . . . . . . . . . . . . . 89
14.1.2 Make a Floor Plan . . . . . . . . . . . . . . . . . . 90
14.1.3 Wireless Devices . . . . . . . . . . . . . . . . . . . 90
14.1.4 Wired Devices . . . . . . . . . . . . . . . . . . . . 90
14.1.5 Central Equipment . . . . . . . . . . . . . . . . . . 91
14.2 Installing the Modem . . . . . . . . . . . . . . . . 92
14.3 Adding the LAN . . . . . . . . . . . . . . . . . . . 92
14.3.1 Configure the Router . . . . . . . . . . . . . . . . . 92
14.3.2 Connect the Router . . . . . . . . . . . . . . . . . 94
88
CHAPTER 14. SELECTING THE PIECES 89
ISPs are categorized by the method they use to provide signal to you: cable,
telephone, wireless, satellite, or power line.
Exam Question 174 (p.329): List in any order the six categories of ISP.
Acceptable Answer: cable, dsl, fiber, wireless, satellite, powerline
Wireless is not the same as Wi-Fi. Wi-Fi is small-radius, local, and not
provided by an ISP. Wireless would be like 3G or 4G, as used by cell phones,
or WiMax or “super Wi-Fi”.
Often there are several ISPs available, including the cable TV company and
the telephone company. WiMax or 4G wireless is starting to be a real
option, but often has capacity limits. Electric companies seem poised to get
into this market as well. And there is always satellite, which may be your
only option in remote locations or on a boat.
Read through the contracts carefully.
Ideally the ISP provides a single routable IP address for you to use. (More
is better, but more is also unusual.)
Ideally the ISP specifies how much bandwidth you will receive. Normally
this is specified in Mb/s up and down, meaning megabits per second for
uploads to the Internet and downloads from the Internet.
Ideally the ISP provides a money-back guarantee if you are not satisfied
within the first 14 days (or some other reasonable period of time).
Ideally the ISP does not restrict the number of computers that you will
eventually attach. If this matters to you, make sure you check carefully. In
the early days of home Internet, it was common to charge extra for each
computer. Some ISPs may still do that. Currently it seems common to just
restrict the total bandwidth.
Ideally the ISP does not charge extra for going over the amount of traffic
you are allowed on your data plan. For wireless Internet, typically there is
a limit. For wired Internet, generally there is no limit, but you need to read
carefully to find out. If there is a data plan, and you reach your maximum,
what happens? Do they limit your usage, or do they bill you extra? Find
out.
Maybe they provide a modem as part of the package, and maybe you have
to buy your own. Find out.
CHAPTER 14. SELECTING THE PIECES 90
Call them to find out how long it would be until they installed your connec-
tion. It may be a couple of days. It may be a month. Find out before you
make your final decision.
Sketch out the locations of all the devices that you expect to be on the
network. You may want to over-estimate and then cut back if you cannot
afford to have them all.
Include the walls. Include the major furniture. Those things can affect the
signal strength of the Wi-Fi. If you do not plan to use Wi-Fi, then you will
still need to run cables somehow.
You should probably plan on having Wi-Fi. It really is the best way to
provide connections for portable devices like laptops, tablets (like the iPad),
and handhelds (like the iPod Touch).
Figure out where the wireless devices will be used. Normally they are used
in living spaces, including bedrooms, kitchen tables, and patio areas.
Normally wireless is used by visitors including friends and relatives that may
drop by or stay overnight when they are in your area.
Do you intend to provide wireless access to neighbors or renters? Do you
want the option to do that later?
How many extra wireless access points? How many computers? How many
printers? How many security systems? How many other things?
Each wireless access point can normally provide three or four ports for
nearby wired devices.
Where will you run the wires? If you do not own the house, your options are
more limited. Often you can put them under throw rugs, behind furniture,
and across the tops of cupboards. Sometimes you can run them out one
window and back in another.
CHAPTER 14. SELECTING THE PIECES 91
It is also possible to set up a wireless bridge. This means that you have an
access point in reverse, more in the role of a receiver than a transmitter.
It supports wired devices, but it communicates wirelessly with the central
access point.
If you do own the house, you have a few more options. Sometimes you can
run wires under the floor, in the crawl space under the house, or in the
attic space over the house. Sometimes you can run them outside the house,
poking out through a wall in one place and back in through a wall someplace
else.
You may be able to have the cable company or the telephone company locate
the modem exactly where you want. But good luck if you want to move it
later. Pick carefully.
If you have many visitors to your home, for example, friends of your children,
you may want a location that you can secure, that is, lock down so people
don’t mess with it. But you want to be able to get to it easily yourself.
You also need electric power to that location, probably including a UPS
(uninterruptible power supply, also called a battery backup).
Exam Question 175 (p.330): What does UPS stand for?
Acceptable Answer: uninterruptible power supply
The router will probably be located very close to the cable modem. It is
not necessary, but it is convenient that way. You need to secure it too. You
might as well secure them together.
You want the hotspots to be reasonably close to all the wireless devices
you intend to support. You want it reasonably close to the living room, for
instance.
Exam Question 176 (p.330): What is a hotspot?
Acceptable Answer: wireless access point
A hotspot, also called a Wi-Fi hotspot, it is just another name for a Wireless
Access Point.
You may find that you need more than one hotspot, maybe because the
house is large, or maybe because the walls are thick or contain metal studs.
Wi-Fi repeaters may help.
CHAPTER 14. SELECTING THE PIECES 92
It is good to have a plan before you start buying things. Once you are ready
to move forward, call your chosen ISP and arrange to get the cable or DSL
line and modem installed.
This part can take several weeks, depending on the backlog for installations,
and other factors like your distance from population centers.
When the installer comes, make sure you have a computer ready to connect
with the modem, either a laptop or a desktop with a sufficiently long cable.
Also make sure you have electricity and maybe a UPS at the spot they will
install your connection.
During installation, there are several things you want to do.
1. Make sure the equipment gets located where you want it.
2. Make sure your computer can access the Internet directly through the
modem. Make sure you can pull up web pages.
3. Make sure your upload and download speeds are in the range you were
expecting. Use something like http://speedtest.net/ to check it out
while the installer is present. If the speed is surprising (too high or too
low), ask about it.
After the installer is gone, disconnect your computer from the modem. This
will cut you off from the Internet.
You can actually configure the router before the installer comes or after the
installer leaves.
CHAPTER 14. SELECTING THE PIECES 93
Connect your computer to your main router. Do not attach the router to
the modem yet. You are still off the Internet.
Use the MAC clone feature, if available, to copy your laptop MAC address
into the router. This will make it possible for you to plug your laptop directly
back into the modem for troubleshooting later. MAC clone means that
your router will pretend to have the same MAC address as your laptop (or
computer).
Set an administrative password on the router. Nobody should know this
but you and very trusted people. Chapter 21 (page 133) talks more about
passwords.
Configure the DHCP on the router. Normally this includes NAT, and NAT
provides a firewall for you. Pick an address range. The default is probably
okay.
Exam Question 177 (p.330): What does default mean?
Acceptable Answer: the setting that is in effect unless you change it
Default is the setting or choice or action that will be in effect or will happen
if you do not specify something else.
During configuration, normally each option will have a default value that is
acceptable to keep just as it is.
Exam Question 178 (p.330): List in either order the two router configu-
ration default values you should not keep.
Required Answer: passwords, ssid
If you care about security, you should change the passwords and your SSID.
Configure the Wi-Fi on the router. Use WPA2 for your encryption. Pick a
Wi-Fi password. It should not be the same as the administrative password.
Everyone that shares the Wi-Fi will know this password.
Exam Question 179 (p.330): List in any order the two passwords a home
router normally has.
Required Answer: admin, wi-fi
Save all your settings.
CHAPTER 14. SELECTING THE PIECES 94
Connect the router to the modem. Your computer should still be connected
to the router.
At this point, you should be able to see the Internet again. Make sure you
can.
You should also test the Wi-Fi to make sure it is working. Walk around
inside and outside the house and see what the signal strength is in various
places.
If you have more routers, switches, wireless bridges, wireless access points,
or wired devices, add them now, one by one.
As you add each item, test it to make sure it is functioning properly.
Then have a party. You will deserve it.
Chapter 15
Contents
15.1 Equipment . . . . . . . . . . . . . . . . . . . . . . 95
15.2 Steps . . . . . . . . . . . . . . . . . . . . . . . . . . 97
15.3 Cable Length . . . . . . . . . . . . . . . . . . . . . 99
15.4 Cable Termination . . . . . . . . . . . . . . . . . . 99
Patch cable is used for wired connections, to connect between routers, switches,
and computers. It uses stranded-core copper wire for flexibility.
It is distinguished from infrastructure wiring that is generally hidden within
walls and terminates at a punch-down block. It generally uses cheaper solid-
core copper wire.
You can buy patch cable ready-made, and that is probably what most people
would do. However, sometimes it is better to make your own patch cable.
In this section, we teach you how.
15.1 Equipment
You will need the following things: (a) cable, (b) ice cubes, (c) crimper,
and (d) tester.
The patch cable wire comes on a spool or in a box. Or we can repurpose
95
CHAPTER 15. MAKING YOUR OWN CAT5 PATCH CABLE 96
an old patch cable that is no longer working. For patch cable, we want the
stranded core.
The ice cubes are 8P8C modu-
lar connectors (male). They are
transparent so you can see what
you are doing. They have an open-
ing on one end where you will in-
sert the properly-trimmed cable,
and they have eight gold-plated
contacts on the other end, where
you will connect to your infras-
tructure wiring. There is a spur
that locks the connector into its
socket. Ice cubes can be purchased
in bulk for under five cents each.
(In 2012 I purchased 100 for $1
plus $2 for shipping.)
CHAPTER 15. MAKING YOUR OWN CAT5 PATCH CABLE 97
15.2 Steps
Use the crimper to cut off one end of your cable, to a nice, square cut.
Use the crimper to cut carefully into the outer sheath of the cable, one half
inch from the end. Your goal is to be able to remove the outer sheath without
CHAPTER 15. MAKING YOUR OWN CAT5 PATCH CABLE 98
damaging any of the eight wires that are inside it, or their individual plastic
coatings.
Push the outer sheath down, exposing more of the wire that is inside.
Untwist the wires. You will find there are four twisted pairs. They are
numbered. Pair number 1 is blue. Pair number 2 is orange. Pair number
3 is green. Pair number 4 is brown. Within each pair, one wire is solid
colored, and one wire has a white stripe. Or maybe it is mostly white with
a colored stripe.
This is an example of wires that
are too long. The sheath is not
pinched inside the ice cube.
CHAPTER 15. MAKING YOUR OWN CAT5 PATCH CABLE 99
For Cat5 cable, the official maximum length is 100 meters. To go farther
than that, you need a repeater or switch.
Exam Question 180 (p.330): What is the maximum length (in meters)
for Cat5 cabling?
Acceptable Answer: 100
We terminate our cable on each end by putting the eight individual wires of
the cable into the eight individual channels of an 8P8C modular connector
(the ice cube).
Lazy Termination: The wires must be in the same order on each end of
the cable. For short cable runs, maybe five or ten feet, that is what really
matters.
Professional Termination: For longer cable runs, we also need to worry
about cross talk. And if someone else will inspect our work, we should follow
CHAPTER 15. MAKING YOUR OWN CAT5 PATCH CABLE 100
Exam Question 181 (p.330): With T568 wiring, are the striped wires odd
or even?
Required Answer: odd
The striped wires go in the odd-numbered channels: 1, 3, 5, and 7.
Exam Question 182 (p.330): With T568 wiring, are the solid-color wires
odd or even?
Required Answer: even
The solid-colored wires go in the even-numbered channels: 2, 4, 6, and 8.
Exam Question 183 (p.330): With T568A wiring, what color goes in slots
CHAPTER 15. MAKING YOUR OWN CAT5 PATCH CABLE 101
1 and 2?
Required Answer: green
Exam Question 184 (p.330): With T568B wiring, what color goes in slots
1 and 2?
Required Answer: orange
For T568A, the green stripe goes in slot 1 and the green solid goes in slot
2. For T568B, the orange stripe goes in slot 1 and the orange solid goes in
slot 2.
Exam Question 185 (p.330): With T568A wiring, what color goes in slots
3 and 6?
Required Answer: orange
Exam Question 186 (p.330): With T568B wiring, what color goes in slots
3 and 6?
Required Answer: green
For T568A, the orange stripe goes in slot 3 and the orange solid goes in slot
6. For T568B, the green stripe goes in slot 3 and the green solid goes in slot
6.
Exam Question 187 (p.330): With T568A wiring, what color goes in slots
4 and 5?
Required Answer: blue
Exam Question 188 (p.330): With T568B wiring, what color goes in slots
4 and 5?
Required Answer: blue
For both T568A and T568A, the blue solid goes in slot 4 and the blue stripe
goes in slot 5. These are the center two slots.
Exam Question 189 (p.330): With T568A wiring, what color goes in slots
7 and 8?
Required Answer: brown
Exam Question 190 (p.330): With T568B wiring, what color goes in slots
7 and 8?
Required Answer: brown
For both T568A and T568B, the brown stripe goes in slot 7 and the brown
solid goes in slot 8.
The only difference between T568A and T568B is that green and orange
CHAPTER 15. MAKING YOUR OWN CAT5 PATCH CABLE 102
swap positions. Blue and brown stay the same with both methods.
A cable that is wired T568A at both ends, or T568B at both ends, is called
a straight-through cable.
A cable that is wired T568A at one end, and T568B at the other end, is
called a crossover cable. Pin 1 goes to 3, pin 2 goes to 6, and vice versa.
Chapter 16
Network Speed
There are two very different kinds of numbers that are commonly associated
with speed: latency and bandwidth.
Latency measures the time it takes to transmit a small amount of informa-
tion from your computer to another computer, and to receive a response.
Gamers often refer to this as lag.
Download Speed measures the time it takes to download a large file from
the Internet to your local computer. Mostly it measures bandwidth.
Upload Speed measures the time it takes to upload a large file from your
local computer to the Internet. Mostly it measures bandwidth.
Example: Telephone lines are very fast in terms of latency but slow in
terms of upload and download bandwidth. A satellite link is typically slow
in latency but fast in upload and download bandwidth.
http://en.wikipedia.org/wiki/Bandwidth_(computing) has a bandwidth
table.
103
CHAPTER 16. NETWORK SPEED 104
Servers
Contents
17.1 Printer Sharing . . . . . . . . . . . . . . . . . . . . 105
17.2 File Sharing . . . . . . . . . . . . . . . . . . . . . . 105
Networks often involve the sharing of printer and files. In this chapter we
show how this can be done by sharing parts of existing computer systems.
The exact how-to depends a lot on the operating system of the host com-
puter. We have chosen to address these tasks in the context of Microsoft
Windows. We will look at printer sharing, file sharing, and configuring ad
hoc wireless networks.
Skill: Print Server: MS Windows provides the ability for your computer to
act as a local print server. (Print servers are also commonly done as separate
interior computers.)
todo: add more
Skill: File Server: MS Windows provides the ability for your computer to
105
CHAPTER 17. SERVERS 106
act as a local file server. Normally the protocol is SMB (Server Message
Block). This provides file-sharing capability between interior computers
(and possibly exterior).
todo: add more
Chapter 18
Contents
18.1 When Trouble Strikes . . . . . . . . . . . . . . . . 108
18.1.1 Global Broadcast Ping . . . . . . . . . . . . . . . . 108
18.1.2 ipconfig (or ifconfig) . . . . . . . . . . . . . . . . . 110
18.1.3 169.254.x.x: Self-Assigned Addresses . . . . . . . . 111
18.1.4 Other Things to Ping . . . . . . . . . . . . . . . . 111
18.2 Have a Laptop Available . . . . . . . . . . . . . . 112
18.3 Check the Modem . . . . . . . . . . . . . . . . . . 112
18.4 Check the Router . . . . . . . . . . . . . . . . . . 114
18.5 Check the Wiring . . . . . . . . . . . . . . . . . . 114
107
CHAPTER 18. TROUBLESHOOTING THE NETWORK 108
If you are setting things up, or making a change to the system, that’s a lot
different from having things suddenly stop working.
For setting things up, skip the rest of this section.
If things suddenly stopped working, usually one thing failed. Try to deter-
mine where the problem might be.
Use your computer to run some commands that test the network.
Try the ping 127.0.0.1 command. 127.0.0.1 is the special address for
localhost. That’s you. If the ping fails, there is something wrong with your
computer. Try turning it off and then on.
We talk more about ping in section 31.2 (page 221).
A global broadcast ping can quickly tell you a lot about yourself and the
local area networks you are currently part of.
Exam Question 191 (p.331): What is a Global Broadcast Ping?
Acceptable Answer: It is a ping to every device that you can reach.
Normally with a global broadcast ping you can only reach devices that are
part of your own current local area network.
That is because devices beyond your local area network can only be reached
by going through a router, and routers normally do not pass along global
broadcast ping requests.
When they do not pass along a request, they are said to filter it out.
If routers did pass along that request, you would get replies from every
device in the entire Internet, so it should be pretty obvious why they filter
it out nowadays.
Exam Question 192 (p.331): What is the command to do a Global Broad-
cast Ping?
Required Answer: ping 255.255.255.255
255.255.255.255 is a special reserved address for global broadcasts. You
CHAPTER 18. TROUBLESHOOTING THE NETWORK 109
would use it when you do not know your own IPv4 address yet.
Exam Question 193 (p.331): With Global Broadcast Ping, who is the
first responder?
Acceptable Answer: The device sending the ping is normally the first to
respond.
You are your own first responder because you are the closest device to your-
self on the network.
You might not be your own first responder if your own computer intention-
ally ignores such requests.
Exam Question 194 (p.331): With Global Broadcast Ping, who is the
second responder?
Acceptable Answer: The router (gateway) connecting you to the rest of
the Internet is normally the second device to respond.
Your router or gateway is almost always the second responder.
Try the ping 255.255.255.255 command. This is called the global broad-
cast ping. If it fails, there is something wrong with your computer. Try
turning it off and then on. If it works, all machines on your local area
network should respond to you.
Some local devices may not respond to your ping request. The most common
reasons are because (a) they are currently turned off, (b) they are turned on
but their wiring is disconnected or broken, (c) they have been configured to
ignore broadcast ping requests, (d) they have been configured to ignore all
ping requests.
Here is a sample global broadcast ping request and responses.
system, generally you will get the first four sets of responses and then it will
automatically stop.
The first line, ping 255.255.255.255, is the command we typed in.
The second line is the ping command telling us what it will do.
The next set of lines say icmp_seq=0. They are the first set of responses that
we received. Each one tells the IP address of the device that is responding.
After a brief delay, we get another set of responses from the same devices.
These will say icmp_seq=1.
After a brief delay, we get another set of responses from the same devices.
These will say icmp_seq=2.
And so it continues until we break out of it, usually by hitting control-c to
cancel the current operation.
From these sets of lines we learn that there are four responsive devices in
our local area network. There may be other devices that are not responding
but usually every device that can respond will respond.
The last three of those responses are marked (DUP!). That is because ping
normally expects one response and anything beyond that is considered to
be a duplicate response.
The response that is not marked (DUP!) is the first response that we re-
ceived. Normally that response is from ourselves. We can deduce that in
this case our IPv4 address is almost certainly 192.168.1.100.
The next response is normally from our router because it is normally the
closest device to us on the network. In this case, the router is almost cer-
tainly 192.168.1.1.
The other responses are from other devices in our LAN. In this case they
are 192.168.1.101 and 192.168.1.103. They are probably other computers.
Try the ipconfig command. It should tell you your Internet address. It
will be something like 192.168.0.100.
Microsoft calls the command ipconfig and Unix-based systems like Macin-
tosh OS X and Linux call the command ifconfig.
CHAPTER 18. TROUBLESHOOTING THE NETWORK 111
If your Internet address starts with 169.254, you were not assigned an IPv4
address within a reasonable amount of time, so your computer simply made
one up. To try again for an assigned address, turn off your machine and
then turn it back on. The 169.254.x.x series of addresses are used when your
machine cannot find a DHCP server. Normally your Router is a DHCP
server. If you do not have a Router, then your ISP provides the DHCP
server.
If you still get a 169.254 address, the problem is with your wiring or your
Router (if you have one), or your ISP (if you do not have a Router).
We will assume that you have a laptop that you can use for troubleshoot-
ing. If it is not a laptop, we need to have enough cable to reach from your
computer to the Modem and to the Router.
In the instructions that follow, we will refer to the computer you are using
as “your laptop.” We will assume it has the ipconfig command available.
If you are using Mac OSX or Linux, the command may be ifconfig instead.
Make sure that Wi-Fi is turned OFF on your laptop. Otherwise, you might
accidentally pick up a signal from some neighbor. You could think you have
Internet when really it is your neighbor that has Internet.
Sometimes wiring problems are due to a loose connection. Wiggle the cable
near each connection. If you discover that it makes a difference, you have
found a problem.
Unit IV
Wireless Networking
116
Chapter 19
Wi-Fi Configuration
Contents
19.1 Wi-Fi Channels . . . . . . . . . . . . . . . . . . . 118
19.2 2.4 versus 5.0 . . . . . . . . . . . . . . . . . . . . . 119
19.2.1 2.4 GHz Advantages . . . . . . . . . . . . . . . . . 119
19.2.2 5.0 GHz Advantages . . . . . . . . . . . . . . . . . 120
19.3 Wi-Fi Channel Selection . . . . . . . . . . . . . . 120
19.4 Wi-Fi SSID . . . . . . . . . . . . . . . . . . . . . . 121
19.4.1 Hidden SSIDs . . . . . . . . . . . . . . . . . . . . . 122
19.4.2 Hiding SSIDs Causes Problems . . . . . . . . . . . 123
19.5 Wi-Fi Security . . . . . . . . . . . . . . . . . . . . 123
117
CHAPTER 19. WI-FI CONFIGURATION 118
The upside of Wi-Fi is that it is easy to install. Very easy. Most home
routers you might buy these days come with Wi-Fi already installed. Most
laptops have Wi-Fi installed. Desktops are even starting to come with Wi-Fi
already installed.
The downsides of Wi-Fi are that it requires some configuration, its range is
limited, it suffers from interference, it is less secure, and you may pick up
free loaders.
Wi-Fi is generally considered to mean the same thing as WLAN.
Much of the newer networking equipment can use either frequency band for
communication. If you have the opportunity to choose, which should you
choose?
The 2.4 band is more widely supported. Everything you buy that is Wi-Fi
capable can work with the 2.4 band.
The 2.4 band has a longer range than the 5.0 band. The 2.4 signal degrades
more slowly as you get farther from the base station. In open air you can
get about 100 meters away and still make contact. For 5.0 you do not get
as much distance.
Exam Question 200 (p.331): Which Wi-Fi band gets better distance, 2.4
or 5.0?
Acceptable Answer: 2.4
CHAPTER 19. WI-FI CONFIGURATION 120
The 5.0 band is less crowded. With 2.4 you are competing with your neigh-
bors in two ways: (a) some hardware can only use 2.4 (but over time this
may change), and (b) 2.4 signals simply travel farther. With 5.0 your neigh-
bors are less likely to be using it, and even if they are they are less likely to
have their signals reach you.
Exam Question 201 (p.331): Which Wi-Fi band has less competition, 2.4
or 5.0?
Acceptable Answer: 5.0
The 5.0 band has more channels. With 2.4 you are pretty much limited to
three channels (1, 6, and 11) because of frequency overlap. With 5.0 there
are somewhere between 9 and 25 channels available, depending on how you
count, and none of them overlap. So 5.0 has many more usable channels:
eight times as many.
Exam Question 202 (p.331): Which Wi-Fi band has more usable chan-
nels, 2.4 or 5.0?
Acceptable Answer: 5.0
Bottom line: 5.0 gives lots more channels with lots fewer users (less inter-
ference), but somewhat less distance and fewer devices that are capable of
operating.
The popular wisdom seems to be that if your equipment can use the 5.0
band, you will get better results by using it.
When you buy a wireless router, odds are good that the channel is pre-set
to 6 (the middle). Then again, so is everybody else’s.
Newer wireless access points may be set to “auto.” They automatically pick
a channel based on doing their own site survey.
You may want to pick a channel. The good choices are 1, 6, and 11. To
make a good choice among those, you need to do a site survey.
Exam Question 203 (p.331): What is a site survey?
Acceptable Answer: You check for Wi-Fi signals that already exist.
A site survey includes running a computer program or using a special
CHAPTER 19. WI-FI CONFIGURATION 121
device that will sniff the air for Wi-Fi signals. It will tell you what your
competition is. If nobody is near you, then it does not matter which channel
you pick. If lots of networks show up in your survey, you should pick the
channel that will create the smallest amount of competition.
Exam Question 204 (p.331): In networking, what does sniff mean?
Acceptable Answer: listen to the network traffic and try to learn from it.
Why 1, 6, and 11? It turns out that using commonly available equipment,
there is too much bleed-over between channels. A study by CISCO, currently
the largest and most influential networking company, showed that placing
active channels any closer than 1, 6, and 11, resulted in less successful traffic.
Specifically, they showed that 1,4,8,11 gets lower throughput than 1,6,11. It
is like painting more lines on the highway without making the road any
wider. Sure you can narrow the lanes by 20% and cars will still fit, and you
may get an extra lane out of the deal, but the cars will have to drive slower
to stay in their lanes. Overall you do not win.
Exam Question 205 (p.332): What 802.11b channels are commonly usable
(in the USA)?
Acceptable Answer: 1, 6, 11
Exam Question 206 (p.332): Why are many Wi-Fi channels not used?
Acceptable Answer: signal bleed
There is too much signal bleed between adjacent Wi-Fi channels.
Acceptable Answer: 32
If you don’t set the SSID, it will probably be something well-known like
“LinkSys” or “D-Link” or some other manufacturer name. That would be
bad because people would know that you did not bother to configure your
access point. They could use the fact that you appear to be lazy to identify
you as an easy target. They may try to break into your router and do bad
things.
It is possible (but uncommon) to use any character in an SSID. It does not
have to be English or European or even printable. Technically, it is just a
string of bits. It has no meaning other than to advertise that your access
point exists, and to match when someone tries to connect.
If your WAP’s SSID is hidden, then the client must broadcast it when it
attempts to connect. It does this by broadcasting its preferred network list.
This seems like a bad idea because it violates the privacy of the client.
Contents
20.1 Antenna Shapes . . . . . . . . . . . . . . . . . . . 126
20.2 Signal Strength . . . . . . . . . . . . . . . . . . . . 127
20.3 Signal Loss . . . . . . . . . . . . . . . . . . . . . . 128
20.4 Signal Loss Example . . . . . . . . . . . . . . . . . 130
Antennas are a great mystery. If you point them in the right direction, you
get better signal reception. If you point them wrong, you get poor reception.
When you drive through a tunnel, your reception is typically bad. If you
live in the mountains, your reception is typically bad.
Wi-Fi suffers from two major signaling problems.
First, by law in the USA, Wi-Fi transmitters are limited to 100 milliwatts
of broadcast power. That is to prevent your transmitter from jamming the
neighbors. Everybody has to stay under 100 mW.
Exam Question 216 (p.332): What is the legal maximum Wi-Fi signal
(in milliwatts) in the USA?
Acceptable Answer: 100
Second, the strength of the signal gets smaller as you get farther from the
access point. When it gets weak enough, you can no longer transmit and
receive useful information.
125
CHAPTER 20. WI-FI ANTENNAS AND SIGNAL STRENGTH 126
This results in a coverage area, the places in your house or nearby where
you can get a good enough signal.
There are some ways to improve the situation.
One solution is to put in more access points, with enough overlap in the
coverage areas that you can always find a good signal in your house.
Another solution is to use one or more directional antennas. These can be
used to push your 100 milliwatts in a certain direction rather than scattering
it uniformly. It is like the difference between having a curved mirror behind
your light bulb, and just a bare light bulb. Both glow just as brightly, but
the mirror pushes the light in a specific direction.
What you need to know: The dispersion of signal is at right angles (90
degrees) to the surface of the antenna. A folded dipole antenna creates a 5
dB gain in a pancake shape. A cantenna creates a 10 dB gain in a single
direction. A parabolic antenna creates a 15 dB gain in a single direction.
FYI: -70 dBm: Weakest Wi-Fi signal that can be usefully received.
Well, that’s all fine and good, but what does that have to do with my Wi-Fi
reception, really?
The important thing is called SNR, the signal to noise ratio. If the noise
gets too high, it drowns out the signal. It is like trying to whisper to each
other at the beach, with the ocean in the background. If you get too far
apart, you will not be able to tell what the whisper was supposed to mean.
Exam Question 219 (p.332): What does SNR stand for?
Required Answer: signal to noise ratio
Exam Question 220 (p.332): In what units is SNR measured?
Required Answer: decibels (dB)
Take microwave ovens. As stated in the list above, a microwave leaks 30
dBm of noise when it is operating. The strongest Wi-Fi signal is 20 dBm.
That gives us a SNR of 10 dB. Oops, make that minus 10 dB. Signal (20)
minus noise (30) is 20 minus 30 = -10. That’s way more noise than signal.
So, start the microwave and lose your Wi-Fi, if you are close enough.
http://xkcd.com/654/ has a cute comic about microwave ovens and Wi-
Fi.
When the SNR is zero or below, it is impossible to detect what was sent.
When the SNR is positive, you can detect something. The higher it is, the
faster you can recognize it. It is kind of like trying to see in a dark room. The
darker the room, the longer it takes to recognize something. The brighter
the room, the faster you can recognize it.
For a practical limit, unless your SNR is 20 dB, it will be too slow to be
useful.
Exam Question 221 (p.332): What is the minimum SNR (in dB) needed
for a usable connection?
Acceptable Answer: 20
holds true for Wi-Fi signal. Every meter farther you go, the signal drops by
0.5 dB.
This is based on the 802.11 frequencies that are commonly used for Wi-Fi.
Beyond regular Wi-Fi, there are other frequencies that get better range.
One example where this comes into play is the so-called Super Wi-Fi, also
known as White Spaces Wi-Fi.
Different frequencies are blocked by different materials. Lead is used to
block x-rays. Regular walls will block visible light but not x-rays.
http://en.wikipedia.org/wiki/White_spaces_(radio) has more.
Back to regular Wi-Fi.
In a perfect world, with -90 dBm background noise, and with 20 dBm initial
signal strength, you can lose 90 dB of signal before it gets down to -70 dBm
and becomes too weak to be useful.
That’s 180 meters of distance. In a perfect world.
In a typical world, you get more like 100 meters. You can only lose about
50 dB before the signal is too weak to be useful.
Exam Question 222 (p.332): What is the typical range (in meters) for
Wi-Fi signals?
Acceptable Answer: 100
Exam Question 223 (p.333): For typical Wi-Fi, how much signal (in dB)
can be used up before the SNR is too low for useful communication?
Acceptable Answer: 50
Skill: Given a floor plan, tell how much signal will be present at various
places.
Here are some signal loss numbers. They are good numbers, but not all
walls are the same. Not all floors are the same.
Exam Question 224 (p.333): For typical Wi-Fi, how much signal (in dB)
is lost per ten meters of open air?
CHAPTER 20. WI-FI ANTENNAS AND SIGNAL STRENGTH 130
Acceptable Answer: 5
Exam Question 225 (p.333): For typical Wi-Fi, how much signal (in dB)
is lost per interior wall (plaster-board, wooden studs)?
Acceptable Answer: 5
Exam Question 226 (p.333): For typical Wi-Fi, how much signal (in dB)
is lost per exterior wall (wood, brick, cement block, metal studs)?
Acceptable Answer: 10
Exam Question 227 (p.333): For typical Wi-Fi, how much signal (in dB)
is lost per floor (thick plywood, support beams)?
Acceptable Answer: 15
If you put your base station in one corner of the house, and you want your
laptop to be able to communicate in the other corner of the house, will it
work?
We need numbers. How far apart are the corners? Let’s say 20 meters. So
we lose 10 dB right there. We had about 50 dB to work with. Now we are
down to 40.
How many floors? Good news. We are on the same floor. Nothing lost
there.
How many exterior walls? Good news again. There are none. We are inside
the house the whole way. But, wait a second. There is a “wet wall” when
we go through a bathroom. That’s a wall with pipes in it. Those walls are
thicker and have more interference. We should count that like an outside
wall. -10 dB leaves us with 30 dB.
How many interior walls? Hmm. Draw a floor plan. Looks like maybe five
interior walls. Each one costs us 5 dB. That’s 25 dB lost. We are now down
to 5 dB available SNR.
Will that be enough? Maybe. But the signal will be weak. We will not get
a good fast connection. We are talking maybe one bar instead of four bars.
Maybe we should think about another place to put the base station. Or
maybe we should run a wire to the other corner of the house and put up
another base station.
CHAPTER 20. WI-FI ANTENNAS AND SIGNAL STRENGTH 131
Security
132
Chapter 21
Passwords
Contents
21.1 How Hackers Hack . . . . . . . . . . . . . . . . . . 134
21.2 Measures of Password Quality . . . . . . . . . . . 135
21.3 How To Pick A Bad Password . . . . . . . . . . . 137
21.4 How To Pick A Good Password . . . . . . . . . . 138
21.5 Reuse: How Many Passwords Do I Need? . . . 139
21.6 Change Passwords How Often? . . . . . . . . . . 142
21.7 What If You Die? . . . . . . . . . . . . . . . . . . 142
Passwords are supposed to make sure that only authorized people get access
to your assets, be that data, the ability to change data, or some other
resource that is yours.
The basic concept is called shared secret. A shared secret is something that
is known only to you and the other party to the activity. On the Internet
you cannot “see” who you are dealing with. The normal way they prove
their identity is by telling you something that nobody else would know.
Passwords are simply shared secrets of this type.
You should have passwords (or something better) to protect your assets.
Exam Question 231 (p.333): Why are weak passwords a significant prob-
lem in networks?
Acceptable Answer: hackers get in and cause trouble
Weak passwords are those that can be discovered easily.
133
CHAPTER 21. PASSWORDS 134
Generally anyone that knows the password can get into the account. They
will then have the same access as the true owner.
Often we say this was done by a hacker, and breaking into an account can
be called hacking in.
The hacker may see information that they should not see. For example,
customer credit card numbers, student grades, or patient’s medical informa-
tion.
The hacker may change information that they should not change. For ex-
ample, changing student grades, or transferring funds.
To avoid becoming the victim, it is helpful to know how hackers hack. Bad-
guy hackers have several methods for breaking into your accounts, including
email, banking, social media, and just plain old shopping websites.
Online Dictionary Attack: First, they run a dictionary attack online
against a very large number of accounts in hopes of finding a username and
password that will let them in. If the username is varied, it is difficult to
stop the attack. Dictionary attacks take a long time because they must go
through the network, and the network is slow. A dictionary is a list of com-
mon passwords, which probably includes words from an actual dictionary,
but also common passwords from other sources. They can use a botnet to
carry out this attack to make it faster, but it is still slow.
Social Engineering: Alternately, they try to convince someone to let them
in. They call tech support and claim to be your secretary that is in a hurry
and in a lot of trouble and desperately needs to get into your account. Or
you are stranded at the airport. Or at a police station. It’s all about telling
a convincing lie. There are pre-written scripts out there.
Escalation: Second, once they find some username and password that gets
them in, they try to do a privilege escalation attack to gain more rights than
that user would normally have. The goal is to get root access. This kind of
attack depends on they operating system for that website, and whether it
is up to date on its security patches. With bad enough security, they could
skip the first step and start here.
CHAPTER 21. PASSWORDS 135
Download: Third, once they have enough access privileges, they download
the password file. These passwords are encrypted, or, more technically,
“hashed,” to hide their original values.
High-Speed Offline Cracking: Fourth, once they have downloaded the
password file, they can use high-speed offline cracking technology to try
lots of possible passwords. This is incredibly faster than the dictionary
attacks. Short passwords or those based on simple patterns are broken
almost immediately.
Reused: Fifth, once they have your username and password pair, they will
try it on other websites. If you are using the same password in more than
one place, they might get into those other places.
Commonly people will say that, among other things, (a) a password should
be long, (b) a password should contain special characters, and (c) a password
should be changed frequently.
But why?
One goal is to defeat hackers that might harm our assets. Hackers have
three main approaches: dictionary attacks, brute-force attacks, and social
engineering.
Dictionary Attack: When we say dictionary attack, what we really mean
is trying everything on a list of commonly used passwords. These lists can
be very long.
Uncommon: Your best defense is to avoid commonly used passwords, which
includes most normal words plus maybe a few digits added to the end.
Brute Force: When we say brute force, we mean trying every possible
password, starting with the shortest ones and working our way up, one
letter at a time.
Long: Your best defense is a long password that has a variety of characters
so it will not be discovered very soon.
Reused Passwords: If a hacker breaks into website A, where you have an
account, and they steal all the passwords, over time they will crack many
of them. Maybe they crack yours because it is too short. They can then
try the same password at other websites where you might have accounts.
CHAPTER 21. PASSWORDS 136
They might get lucky. People often use the same password on more than
one website.
Unique: Your best defense is to use a different password for every website
that matters. For websites that do not matter, anything is fine.
Social Engineering: When we say social engineering, we mean they call
somebody pretending to be somebody, and they fool them into resetting your
password. Hi, I’m Bob’s boss, and he is out sick today, and we desperately
need a file that is in his email. Can you reset his password? Never mind
that you are not Bob’s boss, and Bob is not even out sick today.
Of course, if you are a very important target, maybe they will just kidnap
you and whack you with a tire iron until you give them the password. In a
high-stakes game, you never know what will happen.
Crimes of Opportunity: Another goal is to avoid crimes of opportunity,
where someone accidentally learns your password and then uses it. Maybe
they found a scrap of paper where you had written it down. Maybe they
were watching as you keyed it in. (This is called shoulder surfing.)
Memorable: For writing, your best defense is to memorize your password.
If you write it down, keep the written copy someplace safe.
Complex: For shoulder surfing, your best defense is to have something com-
plex enough that there is no fast and easy way to remember it. Something
like Aloha123 is easy to remember once you have seen it.
Exam Question 232 (p.333): List in any order the four measures of pass-
word quality.
Acceptable Answer: easy for you to remember, not easy for others to
remember, not easy to guess, not used elsewhere
There are several good measures of password quality. (a) Memorable: How
easy is it for you to remember? (b) Complex: How difficult is it for anyone
else to guess? (c) How difficult is it for anyone else to remember, should
they happen to accidentally see it? (d) Unique: If it is discovered, will it
work on other websites?
The common recommendations appear to be designed to meet the first three
goals. Or at least (b) and (c). They don’t help much with (a). In fact, they
defeat (a), which leads to people writing down their passwords, which leads
to defeating (b) since you can find it written somewhere convenient, like on
a yellow sticky on the wall or under the telephone or in the desk drawer.
CHAPTER 21. PASSWORDS 137
Hackers and others that wish to guess your password have several typical
approaches. (a) If they know you, they can try combinations of personal
information such as your telephone number or the name of your spouse or
significant other or pet. (b) Whether they know you or not, they can try lists
of common passwords. This is called a brute force attack, or a dictionary
attack.
Here is a list of the 13 most common passwords found on Gawker when
hackers broke in during December of 2010: 123456, password, 12345678,
lifehack, qwerty, abc123, 111111, monkey, consumer, 12345, 0, letmein,
trustno1.
Would you use any of those? Apparently many did. We can attribute it
to not thinking, or maybe to not caring. After all, if I have an account on
Gawker, do I really care if someone else knows the password?
It would be much more interesting to look at a collection of passwords for
online banking, where presumably more people would care.
But why stop at 13? Hackers have lists of thousands of common passwords.
They can try each of those in an attempt to break into your account. This
is called a dictionary attack. If you care, you need to pick something they
CHAPTER 21. PASSWORDS 138
will not find. If you don’t care, see “password reuse” below.
Do a Google search on “common passwords” for lots more. It makes for
very interesting reading.
Exam Question 233 (p.333): What is the problem with short passwords?
Acceptable Answer: too easy to guess
Yes, stay away from short passwords. Hackers will also try a brute force
attack with all passwords, starting with the blank password, then going
through the 26 letters one by one, then the digits and special characters.
Then all possible two-character passwords. Then all possible three-character
passwords. Depending on their connection, they can get up to five or six
characters pretty fast.
For every character longer that you make your password, assuming it is
unpredictable, you increase the cracking time by a factor of maybe 50. If an
eight-character password takes a minute to crack, a nine-character password
will take an hour, and a ten-character password will take two days.
Exam Question 234 (p.333): What is the problem with long passwords?
Acceptable Answer: too hard to remember
Exam Question 235 (p.333): What is a dictionary attack?
Acceptable Answer: using common passwords in hopes of finding one
that works
Exam Question 236 (p.333): What is the problem with dictionary pass-
words?
Acceptable Answer: too easy to guess
By common, I mean something that is on those dictionary lists used by
hackers.
The best strategy that I have found for passwords you must remember, and
especially one you will share with others (like a Wi-Fi password), is to select
a moderately long but memorable phrase and reduce it to the first letters of
each word. Then mess with the letters.
Memorable Phrase
For example, Lincoln’s Gettysburg Address starts with the words: “Four
CHAPTER 21. PASSWORDS 139
score and seven years ago our fathers brought forth on this continent a new
nation, ...”
These words are familiar to many school children in the USA. By themselves,
they may satisfy (a) and (b), but not (c) because they would be immediately
recognized if seen. Plus they take a long time to type.
Going with the initials, we have “Fsasyaofbfotcann”. It now satisfies (a),
(b), and (c).
If there is very little chance that anyone else will see your password, you can
just type in the whole phrase and not worry about (c).
This also makes for a very nice shared password, because the “insiders” can
be told the secret for remembering it.
Exam Question 237 (p.334): What do I recommend for a password?
Acceptable Answer: initials of a memorable phrase
Mess with the Letters
Beyond this, it could be further modified by replacing the “F” with a “4” and
maybe the “s” with a “7”. Many other replacements might be considered,
such as using digits or special characters that are shaped similarly to the
letters they replace. “A” might be replaced with “4”. “s” might be replaced
with “5”. “O” (oh) might be replaced with “0” (zero). The password is
reduced to gibberish that nobody would guess or remember if seen, but still
you could create it as needed.
After messing we might have “4sa7yaofb40tc1nn”.
Like me, you probably have lots of accounts on lots of web sites. But re-
membering lots of passwords is just a pain. What to do? Write them all
down? Or have one password (or a few) that you use over and over again?
My own strategy is to have one or two passwords that I use every place I
don’t care about. I call them my junk passwords. I don’t use them on my
banking accounts. I don’t use them on my email. But if there is a web site
that could do me little or no harm if someone else stole my identity there,
they get a junk password. Ho hum.
For high-value targets, like bank accounts, where identity theft could cause
CHAPTER 21. PASSWORDS 140
it is a low-value asset.
Exam Question 240 (p.334): Does it matter if a low-value password is
easy to guess?
Required Answer: no
Hackers will use passwords harvested from one website to try to log into other
websites. This works because the login name is often the same (typically an
email address), and people hate to remember very many passwords.
Exam Question 241 (p.334): If several high-value passwords are the same
is that okay?
Required Answer: no
Exam Question 242 (p.334): If several low-value passwords are the same
is that okay?
Required Answer: yes
Password managers exist. In my opinion one of the best is LastPass. An-
other is RoboForm.
https://lastpass.com/ is free to download and use on computers and
laptops. They have a premium version for cell phones.
Exam Question 243 (p.334): Are password managers a good thing?
Acceptable Answer: yes
With a password manager, you just have to learn one master password,
which better be good. Then all the other passwords can be randomly gen-
erated and be different from one another. The password manager fills in the
blanks for you when you are asked to login to a website.
https://askleo.com/are_password_managers_safe/ A friend of mine
has written a nice article about using password managers in general, and
LastPass in specific. His recommendation and others convinced me to change
over to using a password manager several years ago. I did so very cautiously,
but have been very satisfied with the results.
CHAPTER 21. PASSWORDS 142
Some authors suggest that passwords should be changed every three months.
Others suggest every year. Some suggest never.
Exam Question 244 (p.334): List up to three problems with changing
passwords frequently.
Acceptable Answer: written down, forgotten, similar to priors
When passwords must be changed frequently, they are often written down
or similar to past passwords. Or they are forgotten. Some people I know
rely on the “forgot my password” feature a lot, and simply pick passwords
that they never intend to remember.
Exam Question 245 (p.334): What is the problem with changing pass-
words rarely?
Acceptable Answer: more time for hackers to guess them
Short passwords can be discovered quickly. Long passwords can take years
or centuries to be discovered by brute-force search. With a long enough
password, there is no reason to change it unless it may have been discovered.
Sharing passwords is bad. It opens you up to having other people use your
accounts. But what if you die? Do you want your email account to die with
you? Or your Facebook account? Or your bank account? Who owns your
music in the cloud or your other digital assets?
This area of law seems to be still developing (2015), but in some cases you
can contact the account provider with a certificate of death and evidence that
you were appointed to manage the estate, and they will reset the password
for you. That could take a long time, and in the mean time will you be hurt
by being locked out?
I have read about automated systems where you can save an email to be
sent to someone special if you fail to check in every month or so. Such an
email could contain your passwords as well as other final thoughts, wishes,
and apologies for being such a jerk in life.
Or maybe you just trust your spouse or child and you give them your pass-
words.
CHAPTER 21. PASSWORDS 143
Or maybe you put the passwords in a sealed envelope and hide it in a safe.
(That could make it hard to change your passwords very often.)
Chapter 22
Security Protocols
Contents
22.1 VPN: Virtual Private Networks . . . . . . . . . . 144
22.2 TLS (SSL) . . . . . . . . . . . . . . . . . . . . . . . 144
There are several protocols that are mostly automatic and let you, the user,
benefit from a secure connection without the headache of setting it up. You
still have to do a few small things, but they are small.
When using web pages, HTTPS is the secure protocol. It utilizes SSL,
the Secure Sockets Layer, which is now called TLS, Transport Layer
Security, to provide encryption.
144
Chapter 23
Authentication
Contents
23.1 Hackers and Identity Theft . . . . . . . . . . . . 145
23.2 Man in the Middle . . . . . . . . . . . . . . . . . . 149
23.3 Replay Attack . . . . . . . . . . . . . . . . . . . . 150
23.4 Secure Connections . . . . . . . . . . . . . . . . . 150
23.5 Encryption . . . . . . . . . . . . . . . . . . . . . . 151
23.6 The Man is Not Impressed . . . . . . . . . . . . . 153
Security has two main objectives. (a) To keep secrets. (b) To prevent
unauthorized changes.
Authorized people should be able to see the secrets. Unauthorized people
should not be able to see the secrets.
Authorized people should be able to make alterations, additions, corrections,
or any other kinds of changes. Unauthorized people should not.
For a bad guy to break in, the easiest way is to look like an authorized
person.
In the largest sense, identity theft is pretending to be someone else and then
having others believe you. In your pretended role as someone else, you could
145
CHAPTER 23. AUTHENTICATION 146
do good or bad things, but normally we worry about you doing selfish things
that damage the true owner of the identity.
Normally identity can be proven in four ways. Be: it can be based on
something unique that we are, such as DNA, finger prints, or retina scans.
Have: it can be based on something unique that we possess, such as an ID
card, a key, or a document. Know: it can be based on something unique
that we know, such as a password or a shared secret. Do: it can be based on
the ability to physically perform certain acts, or perhaps respond to certain
“challenges.”
Exam Question 246 (p.334): List in any order the four types of things
used to prove identity (four single words).
Required Answer: know, have, are, do
Know: Things you know prove who you are. Passwords are the prime
example.
Have: Things you have prove who you are. Physical keys are the prime
example.
Are: Things about you personally prove who you are. Fingerprints are the
prime example. Biometrics is the generic name.
Problem: Biometrics don’t change. One problem with biometrics is
that you cannot change them. If someone figures out how to hack your
biometrics, then they can use it on all websites. On the other hand, things
you know, have, or can do could be different for each website. But with
biometrics this is a problem. How do you change an iris scan? (Minority
Report?)
Problem: Biometrics do change. Another problem with biometrics is
that we ourselves may change. How good is my voiceprint if I have a cold?
How good is my fingerprint if I cut my finger while working on a project?
Do: Things you can do prove who you are. This is often done in a challenge
/ response configuration, where you are given some pattern and you must
complete it.
In real life, identity is confirmed by having certain documents, such as a
passport or a driver’s license. We present these documents to prove our
identity. Someone checks the documents against our physical person to see
if they believe we are who we claim to be.
In network life, identity is difficult to confirm in that way. Instead we
CHAPTER 23. AUTHENTICATION 147
Both are supported by Google, but they are otherwise unrelated. They
could have the same username and password. If logging into one gets me
automatically logged into the other, then single sign-on is happening. If I
have to log into each one independently, then single sign-on is not happening
there.
Hacker Defined
In general, a hacker is someone who goes beyond the routine ways of using
a tool. They invent creative new ways to use it, ways that were not intended
by the inventors. This can be good or bad.
Exam Question 251 (p.334): What is a hacker?
Acceptable Answer: Someone that goes beyond the routine ways of using
a tool.
Another phrase for this is “thinking outside the box.” The “box” would
be the routine ways things are done. Outside the box would be creative,
unusual ways of doing things.
Exam Question 252 (p.334): Is hacking bad?
Required Answer: no
In computing, hackers are often divided into two categories: white hat
hackers (the good guys) and black hat hackers (the criminals). White hat
hackers are also referred to as ethical hackers.
Exam Question 253 (p.334): What does black hat mean?
Acceptable Answer: It means a bad-guy hacker.
By common usage, the word hacker by itself often indicates one of the
black hat variety.
Exam Question 254 (p.335): What does white hat mean?
Acceptable Answer: It means a good-guy (ethical) hacker.
White hat hackers are often employed to do Pen Testing, meaning penetra-
tion testing. They are hired by companies to try to break in to their own
company. The purpose is to find security weaknesses so they can be fixed
before black hats exploit them.
Exam Question 255 (p.335): What is pen testing?
Required Answer: penetration testing
CHAPTER 23. AUTHENTICATION 149
One problem with passwords is the Man in the Middle attack, previously
mentioned in section 10.2 (page 64).
http://en.wikipedia.org/wiki/Man-in-the-middle_attack has more.
Let’s say Alice and Bob want to communicate. They cannot see each other,
so they rely on a shared secret, a password, to verify each other’s identity.
Alice (to Bob): What’s the password?
Bob (to Alice): Frog lips.
Bob (to Alice): What’s the password?
Alice (to Bob): Spaghetti.
Each knows the correct password. Life is good. They communicate, knowing
who they are talking too.
But now we add Charlie. He is in the middle. To Alice, Charlie pretends to
be Bob. To Bob, Charlie pretends to be Alice.
Alice (to Charlie): What’s the password?
Charlie (to Bob): What’s the password?
Bob (to Charlie): Frog lips.
Charlie (to Alice): Frog lips.
Bob (to Charlie): What’s the password?
Charlie (to Alice): What’s the password?
Alice (to Charlie): Spaghetti.
Charlie (to Bob): Spaghetti.
Charlie knows everything that is going on. Alice and Bob have no way to
verify that they are speaking directly to each other. The secret is out. It is
no longer a secret.
Instead of talking in the clear (using clear text), what if we encrypt all our
messages?
CHAPTER 23. AUTHENTICATION 150
Now that Charlie knows the passwords, he can do business with either Alice
or Bob, pretending to be the other. That’s because the password does not
change.
An interesting alternative is to use a formula as the shared secret. This is
called challenge / response.
Let’s say the formula is 2x + 1. The challenge would be a number, like 5.
The response would be the result from the formula, 11. (2x5+1=11.) This
has the advantage of defeating a replay attack. Of course, in real life the
formula might be much more complicated.
Challenge/Response does not prevent Man in the Middle, but it can limit
it to times that both Alice and Bob are present.
23.5 Encryption
Rot13 Encryption
Charlie, our man in the middle, is not impressed. If Alice and Bob start to
communicate using rot13, it is weak encryption, easily broken.
What if Alice and Bob decide to use something stronger? Charlie might not
be able to figure it out. Especially if they agreed in advance, before Charlie
got into the middle of things.
Contents
24.1 Public and Private Keys . . . . . . . . . . . . . . 154
24.2 Private Messages to Bob . . . . . . . . . . . . . . 155
24.3 Authenticated Messages from Alice . . . . . . . 156
24.4 Private Authenticated Messages from Alice to
Bob . . . . . . . . . . . . . . . . . . . . . . . . . . . 156
24.5 Man in the Middle Defeated . . . . . . . . . . . . 157
24.6 RSA Creates Symmetric Keys . . . . . . . . . . . 157
154
CHAPTER 24. PUBLIC KEY SYSTEMS 155
But only Alice knows her own private key. And only Bob knows his own
private key.
Exam Question 264 (p.335): Who knows Alice’s public key?
Acceptable Answer: everybody
Exam Question 265 (p.335): Who knows Alice’s private key?
Acceptable Answer: Alice
And the keys are symmetric. The public reverses the private, and the private
reverses the public.
Alice can use Bob’s public key to encrypt a message to him that nobody
else can read. When Charlie intercepts the message, Charlie cannot read it.
When Bob finally receives the message, Bob uses his private key to read it.
Nobody but Bob can read a message that is encrypted using Bob’s public
key. The message is truly private.
Exam Question 266 (p.335): Whose key, and which key do you use to
send a private message to Bob?
Acceptable Answer: bob public
Exam Question 267 (p.335): What is the purpose of encrypting a mes-
sage?
Acceptable Answer: Prevent others from understanding it.
Encrypting does not prevent others from intercepting or seeing or capturing
the message. It does not prevent them from transmitting it again, maybe
many times. But it does prevent them from understanding it.
But is it authentic? Can we tell that it came from Alice? Or is it possible
that Charlie made it up, pretending to be Alice?
Because Charlie has Bob’s public key, Charlie could make up the message
and send it to Bob, pretending to be Alice.
How can Bob tell who sent the message?
CHAPTER 24. PUBLIC KEY SYSTEMS 156
Alice can use her own private key to encrypt a message to Bob that nobody
else could have written. When Charlie intercepts the message, Charlie can
read it too. When Bob finally receives the message, Bob uses Alice’s public
key to read it.
Nobody but Alice could have sent a message that is encrypted using Alice’s
private key. The message is truly authentic.
But is it private? No. Charlie can read it. Anyone can read it.
Using the private key to encrypt the message is called signing the message.
It proves authorship.
Exam Question 268 (p.335): What is the purpose of signing a message?
Acceptable Answer: Prove authorship.
Signing does not prevent others from reading it, copying it, or sending it
again. It does not prove who sent it or when it was sent.
Exam Question 269 (p.335): Whose key, and which key do you use to
sign a message?
Acceptable Answer: your private
Anyone can decrypt it with your public key.
Exam Question 270 (p.335): How does signing prove authorship?
Acceptable Answer: private key is required and nobody else has it
If the author is the only person with the private key, then the author is the
only person that could encrypt with that key.
Anything the public key can decrypt must be from the author.
Alice can use her private key (the first layer of encryption) followed by Bob’s
public key (the second layer of encryption) to encrypt a message to Bob.
Notice that the last encryption is using the other person’s public key.
When Charlie intercepts the message, he cannot open it because that would
require Bob’s private key.
CHAPTER 24. PUBLIC KEY SYSTEMS 157
When Bob receives the message, he can open the second layer of encryption
with his own private key. Then he can use Alice’s public key to open the
first layer of encryption, revealing the original message.
Because only Alice could have created it, the message is authentic. It is
from Alice.
Because only Bob could have read it, the message is private. Only the
original author and Bob can know its contents.
Exam Question 271 (p.335): How can Bob send a private, authenticated
message to Alice?
Acceptable Answer: First, encrypt it with Bob’s private key to prove
authorship. Second, encrypt the result with Alice’s public key to provide
privacy.
We must use Bob’s private key to prove authorship.
We must use Alice’s public key to provide privacy.
If we do Bob’s first, then Alice’s, nobody can open the message. That is the
best sequence.
If we do Alice’s first, then Bob’s, everybody can open the message. They
just cannot read it. From a practical point of view it probably does not
matter really which encryption is first and which is second, so long as Alice
can guess the right order to decrypt things.
Using two symmetric keys, Alice and Bob are able to set up communication
with each other. They can pass a message that is authenticated and private.
That message can become their shared secret.
After that, Alice and Bob can use simpler forms of encryption based on their
shared secret. Or they can go back to the two symmetric keys to create a
new shared secret.
RSA was invented by Rivest, Shamir, and Adleman back in about 1970, as
a method for creating a secure channel between two parties, Alice and Bob,
CHAPTER 24. PUBLIC KEY SYSTEMS 158
that were previously unknown to each other. The difficulty in such a case
is to establish a shared secret that can be used later for authentication.
http://en.wikipedia.org/wiki/RSA tells more about it.
In section 24.1 (page 154) we discussed public and private keys, and how
symmetric keys make it possible to defeat a man in the middle attack.
Before RSA, symmetric key systems were common, but public key systems
were not. RSA established the idea that a public key could be widely shared
while a private key was kept confidential.
Before RSA, it was difficult to create a public key that could not be easily
broken to find out the matching private key.
The major contribution of RSA was the creation of a system whereby these
high-quality public and private keys could be easily created.
Exam Question 272 (p.335): What do public-key systems make possible?
Acceptable Answer: strangers can create shared secrets
Exam Question 273 (p.335): Why is RSA special?
Acceptable Answer: public keys are easy to make
What does an RSA public key look like? What does an RSA private key
look like? We can use the commonly-available ssh-keygen command to
create a key pair.
Here is a typical private key. The information is binary but it is stored using
base64 encoding.
c8BGZOwoinSanEeKlhPwguk69xPGzXbmNMbPpSqlhfVvkgvj4lUqB50zElK5Vf
FnmksvwpJp0trzeLg7sCgYEAzAlIfeVreOhefwzmtyIAWs2T8DhqUtHvJsqc2x
DKFGul+oiBY88W6tc/LUyEPsmwkDOboeIQ0XkZWt41w3/dNbXg8o/JdfQhbCAH
7wC4UVdCxkjboa4mEvX2rvAaxvEGh19ekoAgBgxvU5fSs3Sao+443aBDEXo2fp
EhzWBtYnUCgYA8sNAweFsc8nkXaRYgj6xkkKj2lN1WyzeSZh1dPDEHqKtiBwZS
jVd4nGXn+nhpWVgBPnKGI7uFF4c/hPXYw6gmPgliQi6cio/KDj+0/+s7d3FKN5
WNwUt3UhJ1evUSPaqfpZTExa2ManQ2pJDikgmTCQSixpRsh6UhDtW92KrvJQKB
gBF0zd3vjeVXRBZsnSSX5R3frsODoB0b1vEjro3TfuaGWzn3CdLnOde3uLEAde
QFT3TW5X7RH408Zh3vGvxx6RQaTneSM7NCwsVEbElXb22OIKlkPF41zw4aOxO2
eSQCJQPZ9fZkvdimobOuLpmp5T0XOYhEmNha82SauCChGlqtAoGAb9af52myn4
aZu0HHy4prtDEzqK4GxndTpebCLYPaqyK7COlXhaTrDG7uhaKssgLyl7QGvTQI
6SVuXeXx1JBB9rXppcN58bbOxQRG9zTfxNOgzXQ0fbDw04zjwUW7xauR3lHQ1I
1sv6Wibgnv4HX8mLcnfY2xaoE8i2GoeGp2eVc=
-----END RSA PRIVATE KEY-----
Here is the matching public key. It is all one line, but I have broken it
up onto several lines for ease of display. The user@computer at the end is
replaced with the name of the key, which can be pretty much anything.
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC8Z/ilQ2uHSKuoVtHf60qFwx
5umbgYMLt7skc1C1WFN1QgsJdinbaznl1lw7xnoiwCZG+LCZOC1agva39+I3cY
3eyyPj+azPCp+bVs3sp0lNJcwc3MrwYhsrNNt0HqeGENJLW6e9CGHq4u58hXum
zc7DL+BFu1qasmpmdy99p3PCqfDbUnhsyC6FJdGZwsjzFhdyubzqqiXSHsDSJS
6qSB389PC8PcLJb1GPX0NZ1HESCx40zKwKw0DJSoTwFlMGYGHE1Vwj+kc0TAtj
1mxKa4MtPo/9nGJY92xWrKh6Dcb9qP6LL4wSGIrpXiGvt7hyKor6bmx0uVaxdg
g+QBz8p3 user@computer
So, what does it all mean? The mathematics is a bit tricky. We will present
a simplified version that has the major elements you should grasp.
The mathematics involves using really big prime numbers, called p and q.
The private key consists of these two numbers. We are talking like 100 digits
long, each. It turns out that really big prime numbers are actually quite
easy to find. Then you multiply them together to get a 200-digit number,
called n, that is the public key.
(It is a bit more complicated, but only a bit. For our purposes, we will
pretend that p and q are the private key, and that n is the public key. It is
close enough to the truth.)
Exam Question 274 (p.336): What is a prime number?
CHAPTER 24. PUBLIC KEY SYSTEMS 160
RSA is slow, but it is the best known method for creating the shared secret
on which faster methods of communication can then be based.
Chapter 25
Firewalls
Contents
25.1 Client / Server . . . . . . . . . . . . . . . . . . . . 164
25.2 Filtering Traffic . . . . . . . . . . . . . . . . . . . 165
25.3 Client as Server . . . . . . . . . . . . . . . . . . . 165
25.4 Router as Firewall . . . . . . . . . . . . . . . . . . 166
25.5 Firewalls and Gaming . . . . . . . . . . . . . . . . 169
25.6 The Ping of Death . . . . . . . . . . . . . . . . . . 169
162
CHAPTER 25. FIREWALLS 163
The major reason is to recruit your machine into their bot net. A botnet is a
network of computers that are, to some extent, robots under the command of
their hacker overlord. Some botnets have over a million computers involved.
Exam Question 280 (p.336): What is a botnet?
Acceptable Answer: A network of computers controlled by a hacker,
usually without the knowledge of their real owners.
http://en.wikipedia.org/wiki/Botnet has more.
Exam Question 281 (p.336): For what three things are botnets commonly
used?
Acceptable Answer: Sending spam. Mining bitcoins. Doing attacks.
Mining bitcoins is just one example. What we really mean is doing some-
thing that takes lots of compute cycles. Another example is cracking pass-
word hashes.
Attacks are typically DDOS, Distributed Denial of Service attacks. Many
widely separated computers try to talk to the same server at once. The server
could become overwhelmed and confused and stop working. Or the server
could just become so busy that legitimate traffic is not handled promptly.
The “distributed” part is important because an attack from a single com-
puter can be easily fire-walled. When you see a flood of packets from the
same place, you can have an automatic response to block that single source.
But when the packets are coming from a large number of different places it
is very hard to block them without blocking the traffic you still want.
Exam Question 282 (p.336): What does DDOS stand for?
Acceptable Answer: distributed denial of service
Attacks could also be automated attempts to break into other computers,
recruiting more zombies for the botnet, or finding good candidates.
If a hacker takes over your computer, you might not even know it. They
want you to keep the machine turned on so they can use it. Your computer
is referred to as a zombie. The hacker owns your computer. The hacker
elite speak (or leet speak or 1337 speak) term for owned is pwned,
with the o turned into a p, as in “you have been pwned.”
pwn is often pronounced “pown”.
http://en.wikipedia.org/wiki/Zombie_computer has more.
CHAPTER 25. FIREWALLS 164
In its typical form, a firewall looks at the network traffic that is passing
through. The firewall has a list of rules. The rules base decisions on things
like protocol, port number, and source IP address. For example:
* If the packet uses protocol ICMP, send it through.
* If the packet is from xyz, send it through.
* If the packet is from abc, drop it.
* If the packet is for port hij, send it through.
* For any other packet, drop it.
Crafting these rules can be a bit tricky, and we are not really going to address
it in this book, any more than to say that this is basically how it works.
There is a secret. It is the fact that every normal client (machine) is also
set up to act as a server. You may not think of your desktop computer or
your laptop as a server, but it is. Every client has certain ports open and
ready to respond to messages from the Internet.
The simple and classic example of this is the ICMP (Internet Control Mes-
sage Protocol) echo request, known as ping.
According to the rules of the Internet (RFC 1122), if your computer is part
of the Internet it must accept and reply to echo requests.
This forces your computer to be a server, at least a little bit.
There are other examples of your computer acting as a server. It may,
for example, be running Remote Desktop software that allows others to
connect to your machine and use it. Remote Desktop is intended to be a
CHAPTER 25. FIREWALLS 166
way for others to help you, but unintended visitors could exercise the same
privileges.
Who can start a conversation? Normally your computer is just a client and
starts all the conversations that it is a party to. But maybe you are hosting
a game or something. Then your computer is acting as a server and other
clients will start conversations with you.
When you start a conversation, NAT records your IP address and port
number in its table. This allows other computers to respond to your requests.
Unless you do port forwarding or create a DMZ, outsiders cannot start
conversations with you because the NAT table does not give them a way to
reach you.
With NAT, your router acts as a firewall to all interior computers. Because
the interior computers can only receive packets when they go to a port listed
in the NAT address pool, new conversations (service requests) are simply
dropped.
Exam Question 287 (p.336): How can firewalls defend against network
attacks on clients?
Acceptable Answer: outsiders cannot start conversations with clients
If the client starts a conversation with someone outside of the LAN, then a
record is made in the NAT table and responses can be accepted. If there
is no entry in the NAT table outside messages cannot get past the firewall
into the LAN.
Firewalls can also prevent out-bound communication with dangerous loca-
tions. They can stop you from starting a conversation with a known bad
guy, or someone that is administratively restricted, such as a porn website.
Exam Question 288 (p.336): How can firewalls defend against network
attacks on servers?
Acceptable Answer: outsiders can start a few conversations of specific
types with servers
Servers, by their very nature, must handle conversations started by out-
siders. Each conversation takes a certain amount of resources, and if too
many conversations are requested at the same time, those resources can be
CHAPTER 25. FIREWALLS 167
overwhelmed. In some cases, the server can actually crash (or “melt down”)
under that load.
Firewalls can filter out dangerous packets based on type of packet or place
of origin.
If an outsider tries to start more than a few conversations with a server, this
is seen as an attack, and the other conversations are dropped.
Only specific types of conversations may be allowed, meaning conversations
directed at specific ports.
Exam Question 289 (p.336): How does DDOS defeat firewall protection
for servers?
Acceptable Answer: many outsiders can each start a conversation
Because each conversation is coming from a different client, the firewall
cannot limit them based on IP address.
Firewalls provide a defense between yourself and the threats you are trying
to avoid.
Outside Threats: Your home router probably provides the best overall
defense against outside threats. Typically the router does network address
translation (NAT) as part of sharing your Internet connection among several
computers at the same time. This makes each of those computers effectively
invisible to everyone outside of your local area network. However, your home
router has no capability to protect you against inside threats.
Inside Threats: Your operating system typically provides the only defense
against inside threats. The protection varies from system to system, and
specific observations are beyond the scope of this document and this course.
However, it is common to allow files or printers to be shared within your
LAN. This sharing often requires special steps by the owner of the resource
(the files or the printer).
DMZ and Port Forwarding are settings in your router. They can open up
one machine, or parts of several machines, to communication (and therefore
to possible abuse) from things outside your local area network. However,
they are necessary if you want your machine to act as a server. This typically
happens (a) for gaming, if you want to host a game, (b) for running a
personal web site, and (c) for serving video, such as making surveillance
cameras at home visible to you at work.
Exam Question 290 (p.336): What does DMZ stand for?
CHAPTER 25. FIREWALLS 168
Gaming requires a tighter interaction than does using a web browser. With
the browser, time delays can be lengthy and it will merely be annoying. In
gaming, delays can get you kicked out of the game.
To improve performance, gaming computers often become servers to each
other.
The difficulty with NAT is getting past the router firewall to the desired
computer. The computer behind that firewall cannot be reached except
through a port number. The port number must have been registered in the
NAT address pool table.
But there is a way around it. In the router, under the security settings,
there is generally a set of options for things like port forwarding.
Say your game requires you to have port 666 open. You can register your
computer with the router so that any traffic requesting port 666 will be
forwarded to you. That way the port is always open.
If you need more than one port, like say 666 through 671, the router can
usually do that for you also.
There is one obvious drawback with port forwarding. Only one computer
can be the receiver of packets labeled 666. If two people want to host a
game at the same time, you cannot do it. Or even if one person has 666
tied up, and another person wants to host a game, you cannot do it. You
are limited to one host per router.
It is not just gaming though. This also affects things like Skype.
Software developers are aware of these problems. At one time they mostly
assumed each participant would have a personal and fully routable IP ad-
dress. Now they are aware that many participants are behind NAT firewalls.
Over time many of these work-arounds may cease to be needed. But for
now, port forwarding is the primary key to success in getting through the
firewall.
cause trouble when they are opened by the receiving computer. And buffer
overflow is just one way in which the malice can be carried out.
Another opportunity for trouble can come from having Remote Desktop
activated. This tool is designed to let someone far away see your desktop
and help you when you are stuck. But untrusted people could also see and
modify your desktop to “help themselves.”
Unit VI
IPv4 Addressing
172
Chapter 26
Number Bases
Contents
26.1 What is an IP Address? . . . . . . . . . . . . . . 174
26.2 Vocabulary . . . . . . . . . . . . . . . . . . . . . . 174
26.3 Numbering Systems . . . . . . . . . . . . . . . . . 175
26.4 Base 2 Groupings . . . . . . . . . . . . . . . . . . 176
173
CHAPTER 26. NUMBER BASES 174
The actual way that computers are identified on the Internet is by way
of something called an IP address. These are typically written as four
numbers connected by dots. For example, 216.228.254.20 is the IP address
of the computer that sits on my desk at the university where I teach.
Numbers are a fine way for computers to find each other, but humans like
words instead. We see that in the numerous clever attempts to convert
telephone numbers into words. Imagine 1-555-SAVE-NOW. Compare that
to 1-555-728-3669. Which one do you think is easier to remember? For me
it is easier to dial the digits, but easier to remember the words.
Chapter 4 (page 25) reviews the issues that surround domain names.
A whole industry has grown up around the providing of domain names.
They are big business. And it makes it pretty easy to identify the business
or organization that you are visiting on the web.
Domain names are just a front door way to get to the IP address. The IP
address is the real way by which your computer communicates with other
computers on the Internet.
26.2 Vocabulary
Each digit in a base 2 number is called a bit, which is short for binary
digit.
Starting with numbers in base 2, we can group by threes to get base 8
(2x2x2, octal). We can group by fours to get base 16 (2x2x2x2, hex).
And we can group by eights to get base 256.
Octal lets us express numbers in a computer-friendly way with roughly the
same number of digits as we would use in base 10. The down side is that
grouping by three is awkward since there are usually an even number of
total bits to be represented.
Hex (hexadecimal) lets us express numbers in a computer-friendly way with
fewer digits than base 10. Grouping by four is wonderful. The down side
is you need 16 digits, so beyond 9 we use the letters A through F, which is
awkward.
Base 256 is a cross between base 10 and base 2. We group bits into groups of
eight, also called octets. Then we translate each octet into base 10. (This
is exactly what we do with minutes and seconds, except they are base 60.)
Base 256, also called dotted quad, is the notation used for IP addresses,
net masks, and many related concepts in networking.
Skill: Be familiar with the notation for powers, especially powers of two.
Mem: 25 means 2 to the fifth power, and means you multiply 2 by itself 5
times. 2x2x2x2x2 = 32. It is also written as 2^5.
Mem: 2n means 2 to the nth power, and means you multiply 2 by itself n
CHAPTER 26. NUMBER BASES 177
Contents
27.1 Writing Numbers . . . . . . . . . . . . . . . . . . 180
27.2 What’s a Kilo? . . . . . . . . . . . . . . . . . . . . 181
27.3 Popular Numbers . . . . . . . . . . . . . . . . . . 182
27.4 Pre-1981 Network.Host Addressing . . . . . . . 183
27.5 Classful Addressing . . . . . . . . . . . . . . . . . 185
27.6 Network Masks . . . . . . . . . . . . . . . . . . . . 186
27.7 Special Addresses . . . . . . . . . . . . . . . . . . 187
179
CHAPTER 27. IPV4 ADDRESSES: ADVANCED 180
For brevity, instead of requiring people to explicitly say the word “octal” or
“hex”, a traditional notation has grown up that is now widely accepted in
the computing world.
Octal numbers are traditionally written with a zero in front. Thus, octal
755 would be written as 0755.
Exam Question 306 (p.337): The number 0755 is assumed to be in what
number base?
Required Answer: 8
This tradition is to distinguish base-8 (octal) numbers from base-10 (dec-
imal) numbers. Base-10 numbers are written with a non-zero digit at the
front (except for zero itself, which has the same value in octal or decimal).
There is a potential problem when writing two-digit month numbers, such
as 08 for August and 09 for September. Fortunately the meaning is obvious
because 8 and 9 are not octal digits.
Exam Question 307 (p.337): The number 755 is assumed to be in what
number base?
Required Answer: 10
Hexadecimal numbers are traditionally written with a “0x” in front. Thus,
hex 755 would be written as 0x755. It does not matter whether it is a
lowercase x or an uppercase X. Hex 755 could be written as 0X755, but
lowercase is easier to read.
Exam Question 308 (p.337): The number 0x755 is assumed to be in what
number base?
Required Answer: 16
There seems to be a developing tradition to express binary numbers with
a prefix of “0b” or “0B”. This is not universally accepted, but is gaining
momentum.
The key notational concept seems to be that a leading zero means “this is
not base 10” and the next character tells what base it really is. If 0-7, it is
octal. If x or X, hex. If b or B, binary.
CHAPTER 27. IPV4 ADDRESSES: ADVANCED 181
Just as there is a short billion and a long billion (see 26.3, page 175 above),
there is a “short” kilo and a “long” kilo. (I just made those names up. I
don’t know if anyone else calls them that. I am not sure what their standard
name is.)
Skill: Understand that kilo and kilo may mean different things.
Exam Question 309 (p.337): What are the two meanings of kilo?
Acceptable Answer: Ten to the third power, and two to the tenth power.
A marketing kilo is ten to the third, a thousand: 1000. Humans typically
use base-10 numbers. Ten to the third power means three tens multiplied
together. The result is 1000.
We usually write ten to the third as 103 or as 10^3.
A computer engineering kilo is two to the tenth: 1024. Computers are
designed to use base-2 numbers. Two to the 10th power means ten twos
multiplied together. The result is 1024.
We usually write two to the tenth as 210 or as 2^10.
Because 1000 and 1024 are so close to the same number, they are both called
a kilo.
Computer engineering is more closely tied to the underlying operation of the
equipment. Since computational equipment including networking equipment
uses base 2 as its native numbering system, 1024 makes good sense.
Marketing tends to like basing things on 1000 because it is easily defensible
and it makes computing equipment look somewhat bigger than what the
computer engineers would say.
Exam Question 310 (p.338): What are the two meanings of meg?
Acceptable Answer: Ten to the sixth power. Two to the 20th power.
A marketing meg is ten to the sixth, a million: 1000 * 1000.
A computer engineering meg is two to the twentieth: 1024 * 1024.
Exam Question 311 (p.338): What are the two meanings of gig?
Acceptable Answer: Ten to the ninth power. Two to the 30th power.
A marketing gig is ten to the ninth, a billion: 1000 * 1000 * 1000.
A computer engineering gig is two to the thirtieth: 1024 * 1024 * 1024.
CHAPTER 27. IPV4 ADDRESSES: ADVANCED 182
In networking as well some numbers are much more popular than others.
And it is because they are round in some sense. For networking, round
means how they look in base 2, binary. And they come up a lot more often
than the non-round numbers.
Skill: Quickly recognize and use the common IPv4 numbers: Powers of 2.
These are the only numbers that appear in (dotted quad) subnet block sizes.
(Spaces have been added for clarity, but normally they are left out.)
Mem: binary 00000000 is 0
Mem: binary 0000000 1 is 20 = 1 (multiply no 2s)
Mem: binary 000000 1 0 is 21 = 2 (multiply one 2)
Mem: binary 00000 1 00 is 22 = 4 (multiply two 2s)
Mem: binary 0000 1 000 is 23 = 8 (multiply three 2s)
Mem: binary 000 1 0000 is 24 = 16 (multiply four 2s)
Mem: binary 00 1 00000 is 25 = 32 (multiply five 2s)
Mem: binary 0 1 000000 is 26 = 64 (multiply six 2s)
Mem: binary 1 0000000 is 27 = 128 (multiply seven 2s)
Skill: Quickly recognize and use the common IPv4 numbers: Negative Pow-
ers of 2. These are the only numbers that appear in (dotted quad) net masks.
They are also the boundaries between the address classes. (Spaces have been
added for clarity, but normally they are left out.)
Mem: binary 11111111 is 256 - 20 = 255
Mem: binary 1111111 0 is 256 - 21 = 254
Mem: binary 111111 00 is 256 - 22 = 252
Mem: binary 11111 000 is 256 - 23 = 248
Mem: binary 1111 0000 is 256 - 24 = 240 (also start of class E)
Mem: binary 111 00000 is 256 - 25 = 224 (also start of class D)
Mem: binary 11 000000 is 256 - 26 = 192 (also start of class C)
Mem: binary 1 0000000 is 256 - 27 = 128 (also start of class B)
Mem: binary 00000000 is 256 - 28 = 0 (also start of class A)
We will talk about classes and network masks shortly.
Before 1981, the Internet, then called the ARPANet, used 8-bit network
addresses and 24-bit host addresses. This is before the introduction of classes
A, B, and C.
CHAPTER 27. IPV4 ADDRESSES: ADVANCED 184
Since the network.host split had become variable, instead of always being
an 8.24 split, programs had to be updated. Programmers are lazy and hate
to update anything twice if they can spend the extra time to get it updated
correctly the first time.
To handle this variation in splits, a lot of programming was done using the
knowledge that class A was always an 8.24 split, and class B was always a
16.16 split, and class C was always a 24.8 split.
net mask: Given a computer address, like 20.1234, programmers needed to
separate that address into its two parts. They did this mathematically by
using something called a mask. The mask consisted of ones for the things
they wanted to keep and zeroes for the things they wanted to get rid of.
The logic behind this relates to AND and OR, with 1 standing for TRUE
and 0 standing for FALSE. Computers can do this calculation really fast.
For class A, the net mask is 11111111.000000000000000000000000. It con-
sists of eight 1s followed by 24 0s.
For class B, the net mask is 1111111111111111.0000000000000000. It con-
sists of 16 1s followed by 16 0s.
For class C, the net mask is 111111111111111111111111.00000000. It con-
sists of 24 1s followed by eight 0s.
Programmers, being human and not machines (a statement that some might
dispute), found two improvements to this notation. The first was to separate
the 32 bits into four groups of 8. Thus:
For class A, the net mask is 11111111.00000000.00000000.00000000.
For class B, the net mask is 11111111.11111111.00000000.00000000.
For class C, the net mask is 11111111.11111111.11111111.00000000.
CHAPTER 27. IPV4 ADDRESSES: ADVANCED 187
The second was to convert each set of 8 into base 10 numbering. Maybe this
was for the sake of their managers. In any case, the result was shorter.
For class A, the net mask is 255.0.0.0.
For class B, the net mask is 255.255.0.0.
For class C, the net mask is 255.255.255.0.
That is because 11111111 (eight 1s) is the base 2 (binary) number that is
equivalent to 255 in base 10 (decimal). And 00000000 in any base is always
the same: 0.
Some IPv4 addresses were given special significance. They were not just any
old address. Here is the list.
Contents
28.1 CIDR Routing . . . . . . . . . . . . . . . . . . . . 191
28.2 Classless Addressing . . . . . . . . . . . . . . . . . 192
28.3 Subnet Block Size . . . . . . . . . . . . . . . . . . 193
28.4 Subnet Count . . . . . . . . . . . . . . . . . . . . . 196
28.5 First Usable Subnet . . . . . . . . . . . . . . . . . 197
28.6 Last Usable Subnet . . . . . . . . . . . . . . . . . 197
28.7 Current Subnet . . . . . . . . . . . . . . . . . . . . 198
28.8 IPv4 Summary . . . . . . . . . . . . . . . . . . . . 200
191
CHAPTER 28. IPV4 ADDRESSES: CLASSLESS 192
Skill: Given an IPv4 address, tell the default Net Mask in CIDR and dotted
quad notation.
Mem: For class A, CIDR is /8, net mask is 255.0.0.0
Mem: For class B, CIDR is /16, net mask is 255.255.0.0
Mem: For class C, CIDR is /24, net mask is 255.255.255.0
Exam Question 344 (p.339): For 199.199.199.199, what is the default Net
Mask in CIDR and dotted quad notation?
Acceptable Answer: /24 and 255.255.255.0.
prices came down and networking prices came down, there was great pressure
to further subdivide the B and C addresses (and the A addresses too).
It was too late to redesign the overall plan for Classful Addressing. Too
many people were using it. Too many programs depended on it.
But CIDR and the net mask concept provided an opportunity to go the
other way. Instead of aggregating things into super-nets, they could be
further divided into subnets.
To keep clear the division between network bits and host bits, it would
be necessary to utilize an explicit subnet mask telling exactly how many
bits were network. There was already an implicit mask based on the first
number in the IP address. Now things were going to be expressed and not
just assumed.
Skill: Given a CIDR subnet, tell what the subnet mask is in dotted quad
notation. (Be able to do this for /8 through /30.)
Q: For /21, what is the subnet mask?
A: /20 = 11111111.11111111.11110000.00000000 = 255.255.240.0.
A: /21 = 11111111.11111111.11111000.00000000 = 255.255.248.0.
A: /22 = 11111111.11111111.11111100.00000000 = 255.255.252.0.
A: /23 = 11111111.11111111.11111110.00000000 = 255.255.254.0.
A: /24 = 11111111.11111111.11111111.00000000 = 255.255.255.0.
A: /25 = 11111111.11111111.11111111.10000000 = 255.255.255.128.
A: /26 = 11111111.11111111.11111111.11000000 = 255.255.255.192.
A: /27 = 11111111.11111111.11111111.11100000 = 255.255.255.224.
CHAPTER 28. IPV4 ADDRESSES: CLASSLESS 194
Skill: Given a CIDR subnet, tell what the subnet block size is in dotted
quad notation.
Exam Question 345 (p.340): For /10, what is the subnet block size?
CHAPTER 28. IPV4 ADDRESSES: CLASSLESS 195
Subnet Table
Q1 Q2 Q3 Q4 pow neg
/1 /9 /17 /25 128 128
/2 /10 /18 /26 64 192
/3 /11 /19 /27 32 224
/4 /12 /20 /28 16 240
/5 /13 /21 /29 8 248
/6 /14 /22 /30 4 252
/7 /15 /23 /31 2 254
/8 /16 /24 /32 1 255
Skill: Given an IPv4 subnet mask, tell what the subnet block size is in
dotted quad notation.
Exam Question 348 (p.340): For 255.255.248.0, what is the subnet block
size?
Acceptable Answer: 0.0.8.0
(sub) 0.0.0.0 minus 255.255.248.0 = 0.0.8.0
(add) 255.255.248.0 + 0.0.8.0 = 0.0.0.0
(tbl) 248 in the neg column, in quad 3, gives you /21.
Skill: Given an IPv4 address and a CIDR subnet, tell how many subnets
there are, assuming subnet-zero.
Q: For 150.150.150.150/21, how many subnets are there (with subnet-
zero)?
A: 25 = 32.
A? 21-16 (class B) = 5 bits.
Skill: Given an IPv4 address and a CIDR subnet, tell how many subnets
there are, assuming no subnet-zero.
Q: For 150.150.150.150/21, how many subnets are there (no subnet-zero)?
CHAPTER 28. IPV4 ADDRESSES: CLASSLESS 197
A: 25 − 2 = 30.
Skill: Given an IPv4 address and a CIDR subnet, tell what the first usable
subnet address is in dotted quad notation, assuming subnet-zero.
Q: For 150.150.150.150/21, what is the first usable subnet address (with
subnet-zero)?
A: 150.150.0.0.
A? With subnet-zero, the first usable subnet is always the same as the
network address.
Skill: Given an IPv4 address and a CIDR subnet, tell what the first usable
subnet address is in dotted quad notation, assuming no subnet-zero.
Q: For 150.150.150.150/21, what is the first usable subnet address (no
subnet-zero)?
A: 150.150.8.0.
A? With no subnet-zero, the first usable subnet is always the network ad-
dress plus the block size. 150.150.0.0 + 0.0.8.0 = 150.150.8.0.
With no subnet-zero, the last usable subnet address is the next network
address minus two block sizes.
In calculating the next network address, be careful to remember whether
the network is class A, B, or C.
Skill: Given an IPv4 address and a CIDR subnet, tell what the last usable
subnet address is in dotted quad notation, assuming subnet-zero.
Q: For 150.150.150.150/21, what is the last usable subnet address (with
subnet-zero)?
A: 150.150.248.0.
A? It is always the next network address minus the block size. 150.151.0.0
minus 0.0.8.0 = 150.150.248.0.
Skill: Given an IPv4 address and a CIDR subnet, tell what the last usable
subnet address is in dotted quad notation, assuming no subnet-zero.
Q: For 150.150.150.150/21, what is the last usable subnet address (no
subnet-zero)?
A: 150.150.240.0.
A? It is always the next network address minus the block size x2. 150.151.0.0
minus 0.0.8.0 x2 = 150.150.240.0.
For 128, the multiples would be 0 and 128. That’s way easy.
So, watch out for the 16s and 32s.
You don’t actually need all of those numbers. You just need the one that is
before and the one that is after the current IP address.
Let’s work through an example: For 1.2.3.150/28, what are the subnet ad-
dress, first usable host, last usable host, and broadcast address?
Quad 4 is where the split occurs. The block size is 16. The multiples of 16
that surround 150 are 144 and 160.
Why quad 4?
Before /8 is quad 1. After /8 and before /16 is quad 2. After /16 and before
/24 is quad 3. After /24 and before /32 is quad 4.
/28 is after /24 and before /32, so quad 4 is where the split occurs.
Why multiples of 16?
/32 is the end of the quad. From /28 to /32 we have four bits for host
addressing. 32 − 28 = 4
Four bits of host addressing gives us 16 addresses. 24 = 16
The subnet address is 144 because that is the multiple of 16 that comes
at or before 150.
The first usable host is always just one beyond the subnet address.
The next subnet address is 160 because that is the multiple of 16 that
comes after 150.
The broadcast address is always just one before the next subnet address.
The last usable host is always just two before the next subnet address.
Skill: Given an IPv4 address and a CIDR subnet, tell what the current
subnet address is, meaning the subnet in which that IPv4 address occurs.
Q: For 150.150.150.150/21, what is the current subnet address?
A: 150.150.144.0.
Skill: Given an IPv4 address and a CIDR subnet, tell what the first usable
host address is in dotted quad notation.
Q: For 150.150.150.150/21, what is the first usable host address?
A: 150.150.144.1.
CHAPTER 28. IPV4 ADDRESSES: CLASSLESS 200
Skill: Given an IPv4 address and a CIDR subnet, tell what the last usable
host address is in dotted quad notation.
Q: For 150.150.150.150/21, what is the last usable host address?
A: 150.150.151.254.
Skill: Given an IPv4 address and a CIDR subnet, tell what the default
broadcast address is in dotted quad notation.
Q: For 150.150.150.150/21, what is the default broadcast address?
A: 150.150.151.255.
An important question that is often asked is whether two IP addresses are
in the same subnet or not.
Skill: Given an IPv4 address and a CIDR subnet, tell whether another
specified IPv4 address is in the same LAN.
Q: For 150.150.150.150/21, is 150.150.149.149 in the same LAN?
A: Yes.
Q: For 150.150.150.150/21, is 150.150.155.155 in the same LAN?
A: No.
You probably thought this unit would never end. It just about didn’t.
What’s the take-away? What do you really need to know?
When you are configuring a home router or home wireless, you need to pick
an IP address range.
Normally there is a default. Often it is 192.168.0.0/24. You can run into
trouble if you have more than one router. They cannot both have the same
address. Something has to change.
If you understand how the addressing works, you can make that change.
What else?
As you move into more advanced networking classes, you will be making
networks with not just one or two routers, but with lots of them. You need
to organize your addresses so they make sense and do not cause conflicts.
This leads you into subnets and block sizes and how many subnets you can
CHAPTER 28. IPV4 ADDRESSES: CLASSLESS 201
have and how many hosts can be in each subnet. It leads to easy-to-ask
questions like, “what is the first usable subnet and the last usable subnet?”
And questions like, “what is the first usable host in a subnet, and the last
usable host, and the broadcast address?” These show up a lot on certification
tests.
What else?
Sometimes the network around you is failing. Common causes are things
like the servers dying, power outages, or wires being cut by construction
equipment.
If you have networking skills, you can get around some of those problems.
You can be up and running while everyone else is taking a break.
Maybe this is not such a smart idea after all ... .
Just kidding.
When you are on the road, and you want to get on the Internet, it can be
very helpful to know what’s going on and how to fix it.
Chapter 29
VLSM
Contents
29.1 Explanation . . . . . . . . . . . . . . . . . . . . . . 202
29.2 Steps To Follow . . . . . . . . . . . . . . . . . . . 206
Why do all the subnets have to be the same size? Good question. Origi-
nally subnets were the same size because the subnet mask was imposed at
the network level by the routers. Eventually the routing protocols started
carrying around the subnet masks so they could be different in each subnet.
Chapter 36 (page 258) goes deeper into routing.
Exam Question 349 (p.340): What does VLSM stand for?
Acceptable Answer: variable length subnet mask
http://en.wikipedia.org/wiki/VLSM has more on CIDR and VLSM.
29.1 Explanation
202
CHAPTER 29. VLSM 203
A network can be divided into subnets so long as each subnet starts on the
proper boundary. A subnet of size 0.0.0.4 (/30) must start on a multiple of
0.0.0.4. A subnet of size 0.0.64.0 (/18) must start on a multiple of 0.0.64.0.
To divide a network into subnets, first identify the LANs (broadcast do-
mains) that will be involved. For each LAN determine how many hosts
(sometimes called users) will be involved.
For those small router-to-router subnets there are only two hosts (the routers).
In this case, you need four IP addresses, and the subnet size is 0.0.0.4.
Others subnets will have actual servers or end users. When you count hosts
within a LAN, be sure to include any routers and other less-obvious things
like servers, networked storage, photocopy machines, and printers. And
in real life you would probably estimate on the high side to allow for a
reasonable amount of future growth, but on an exam just go with what they
tell you.
Exam Definition: A user and a host may be the same thing, and maybe
not. If there is no other information provided, assume the words mean the
same thing.
CHAPTER 29. VLSM 207
In any case find the number of hosts, add two (to allow for the first and last
IP address in the block), and then round up (if necessary) to the next power
of 2.
For example, if you have 47 hosts, you need 49 IP addresses and a subnet
size of 0.0.0.64. If you have 63 hosts, you need 65 IP addresses and a subnet
size of 0.0.0.128. The result will be your minimum subnet size for that LAN.
At the end of this process, you should know how many LANs you have, and
how many IP addresses you need in each LAN.
Assign the locations for your biggest blocks first. If you get them lined up
properly, everything else will fit snuggly.
Look at the range of IP addresses that are available to you. Starting with
the largest LAN, assign it a location that starts with a multiple of the LAN
size. For example, if the LAN size (rounded up to a power of 2) is 64, you
must start it at x.x.x.0 or x.x.x.64 or x.x.x.128 or x.x.x.192.
Continue assigning LANs from largest to smallest. So long as you start each
on a compatible boundary, any assignment is legal.
Common Errors: (a) make sure each LAN starts on the right boundary,
which is a multiple of the LAN block size. (b) make sure the LANs do not
overlap each other, or any restricted addresses.
Chapter 30
Ports
Contents
30.1 Important Port Numbers . . . . . . . . . . . . . . 209
30.1.1 80: HTTP . . . . . . . . . . . . . . . . . . . . . . . 210
30.1.2 443: Secure HTTP . . . . . . . . . . . . . . . . . . 210
30.1.3 21: File Transfer Protocol . . . . . . . . . . . . . . 210
30.1.4 22: Secure Shell . . . . . . . . . . . . . . . . . . . 211
30.1.5 23: Telnet . . . . . . . . . . . . . . . . . . . . . . . 211
30.1.6 25: Email . . . . . . . . . . . . . . . . . . . . . . . 211
30.1.7 53: DNS . . . . . . . . . . . . . . . . . . . . . . . . 211
30.1.8 123: Network Time Protocol . . . . . . . . . . . . 212
30.2 Making a Request . . . . . . . . . . . . . . . . . . 212
30.3 Servicing a Request . . . . . . . . . . . . . . . . . 214
30.4 Being a Server . . . . . . . . . . . . . . . . . . . . 214
30.5 Security . . . . . . . . . . . . . . . . . . . . . . . . 214
In this chapter we collect together and expand on things we have already said
about ports. There is also a discussion of ports in the section on firewalls
in chapter 25 (page 162).
Besides having a destination IP address, messages also have a destination
Port number.
When you talk to a computer, you don’t just talk to a computer. You talk
to a computer program inside that computer. You specify the program by
specifying a port number. Port numbers range from 0 to 65535.
208
CHAPTER 30. PORTS 209
In effect, when the computer starts up, it also starts up a bunch of programs.
Some of those are willing to receive messages. Those programs tell the
computer, hey, if you get a message for port 123, send it to me.
Each program on that computer, if it wants to receive messages, has a port
number.
Exam Question 350 (p.340): What is a software port?
Acceptable Answer: a number that tells which program should receive
the message
We have mentioned ports several times. In this section we go over everything
we know and try to bring it together.
The word port has two meanings. A port (physical) is typically a mostly
square hole on the back of a router or switch. You plug in a network cable
(8P8C, Cat 5 or similar) to connect it to another piece of equipment, such
as a computer.
A port (software) is a number between 0 and 65535. You can think of it
as a post office box within the computer. The number tells which server
(software) should receive the message.
Exam Question 351 (p.340): Software port numbers range from 0 up to
what number?
Acceptable Answer: 65535
http://en.wikipedia.org/wiki/List_of_TCP_and_UDP_port_numbers has
more information.
Port numbers have a sixteen-bit range, meaning that it covers all of the
whole numbers that can be expressed in sixteen bits. 65535 is equal to
216 − 1.
http://en.wikipedia.org/wiki/Port_numbers has more on port num-
bers.
Here are some of the more important port numbers. This is obviously not
a complete list.
http://www.iana.org/assignments/port-numbers has an official, com-
plete list of generally recognized port numbers.
CHAPTER 30. PORTS 210
Exam Question 355 (p.340): What is port 443 normally used for?
Acceptable Answer: https
Exam Question 356 (p.340): What port does https normally use?
Required Answer: 443
Exam Question 357 (p.340): What does https stand for?
Required Answer: hyper text transfer protocol secure
Required Answer: 53
Exam Question 371 (p.341): What does dns stand for?
Required Answer: domain name system
The domain name system converts human-readable domain names into nu-
meric IP addresses.
The purpose for being on the network is to be able to send and receive
messages (information). Normally the process starts with a request for in-
formation.
CHAPTER 30. PORTS 213
The device making the request is called the client. The computer that will
receive the request and respond to it is called the server.
Exam Question 375 (p.341): What does a client do?
Acceptable Answer: make requests
Normally the client expects to receive a response from a server. (In rare
cases, the client may not expect a response.)
Exam Question 376 (p.341): What does a server do?
Acceptable Answer: answer requests
The requests come from clients. Normally the server replies to the client. It
is said to “service” the requests.
Notice that receiving requests is not the same as answering requests. Hackers
send requests to random places all the time. In many cases those requests
go unanswered. But if the request gets an answer, then they know they are
talking to a server, even if it is a very limited server.
Receiving requests is not the same as receiving messages. Requests start new
conversations. The server is ready, willing, and able to service the requests,
but it does not know when or if ever the requests will come.
Messages, on the other hand, if they are not requests, are responses to
previous messages. Because they are expected, firewalls typically provide a
fast way for such messages to get through.
Computers that are on the network but are not servers are called clients.
Normally clients are placed behind a firewall to prevent new conversations
from reaching them.
It is common for several client programs to be communicating at the same
time. Each program will be expecting replies to its requests.
Because a reply is normally expected, the sending computer always includes
a return address with the request. The return address includes a port num-
ber, assigned seemingly at random, where the reply can be delivered. The
port number identifies the program that should be given the reply when it
arrives.
CHAPTER 30. PORTS 214
Requests are handled by servers. The word server can refer to the entire
machine on which the request is serviced, or it can refer to the specific
computer program that will service the request.
Exam Question 377 (p.341): What two things does server mean?
Acceptable Answer: software that answers requests, hardware where such
programs run
Randomly assigned port numbers work fine for clients, but do not work well
for servers. Instead, servers use well-known port numbers to receive their
requests.
It is important to know port numbers because you may need to open holes in
your firewall to allow those ports to be used, or you may want to specifically
block them to prevent those services (like email).
http://en.wikipedia.org/wiki/Port_numbers has more on port num-
bers.
30.5 Security
Power Tools
215
Chapter 31
Contents
31.1 ipconfig . . . . . . . . . . . . . . . . . . . . . . . . 217
31.1.1 ipconfig (Windows) . . . . . . . . . . . . . . . . . . 217
31.1.2 ifconfig (Linux, Mac OS X) . . . . . . . . . . . . . 220
31.2 ping . . . . . . . . . . . . . . . . . . . . . . . . . . . 221
31.2.1 ping localhost . . . . . . . . . . . . . . . . . . . . . 224
31.2.2 Step 2: ping Yourself . . . . . . . . . . . . . . . . . 226
31.2.3 Step 3: ping Your Neighbor . . . . . . . . . . . . . 227
31.2.4 Step 3a: ping Your Neighbors . . . . . . . . . . . . 229
31.2.5 Step 3b: ping Your Neighbors . . . . . . . . . . . . 230
31.2.6 Step 4: ping Something Beyond . . . . . . . . . . . 231
216
CHAPTER 31. BASIC POWER TOOLS 217
Wide Examples
Many of the sections in the chapters on tools include printouts of the actual
use of the tool. In many cases these printouts are wide, extending beyond
the width of the page. Some material is lost.
We decided to allow these printouts extend as they will, and in some cases be
cut off at the edge of the page, because (a) the material lost is of small value,
(b) folding the lines makes things more confusing (and it is more work), and
(c) shrinking the font size is harder on the eyes, especially because (a) the
material lost is of small value.
31.1 ipconfig
windows7> ipconfig
Windows IP Configuration
Windows IP Configuration
Default Gateway . . . . . . . . . : ::
NetBIOS over Tcpip. . . . . . . . : Disabled
ubuntu> ifconfig
macosx> ifconfig
31.2 ping
In case of network problems, ping is often the first tool that is used to
understand the problem.
The ping command verifies connectivity and also measures latency (net-
work delay).
If ping works, the network is connected and working between the two com-
puters that were involved. Lots of things had to be working. Ping proves
that they were all working.
If you let ping run for a while, you will see one of three things. (a) nothing
is getting through. (b) everything is getting through. (c) sometimes things
get through and sometimes they do not.
Do not worry about the first ping or two. Sometimes parts of the network
go to sleep when they are not in use, and it can take a second or two to
wake up. Specifically, they may have tables of information that has gotten
stale, and they may need to refresh it.
If you have case (c), we call that an intermittent error. Intermittent means
CHAPTER 31. BASIC POWER TOOLS 222
This demonstrates that your own network stack (software) is working, and
your network interface card is working, and your wiring is working, and your
router is working, and something beyond your LAN is working.
That is the conventional wisdom. You start small and expand, especially
when you are having trouble.
In an ideal world, all four steps will be successful. In a paranoid world
(like we actually live in), some of them will fail even though they should be
successful.
Actually, because your local machine may have firewalls that interfere, you
should go in this order: (x) ping 255.255.255.255, (3) ping your gateway, (4)
ping something beyond your network, and if necessary (1) ping localhost,
and (2) ping yourself.
Each ping can give you information about things that are working. Once you
have figured out what is working, and narrowed down what is not working,
then you can go about fixing it.
If (4) works for even one web site, then your Internet connection is up and
running. None of the other pings matter.
If (4) fails, try other web sites. Perhaps the first one is just blocking ping.
If (4) fails for all web sites, but (3) works, then your personal computer is
working and your gateway (router) is working, but your ISP link is probably
down. Power off your modem. Wait a minute. Then apply power again.
Wait a minute. Then try pinging it again. Power off and power on will
reset the modem and often solves the networking problem. If the problem
persists, you are ready to call your ISP and report that your Internet seems
to be down.
If (4) fails and (3) fails but (2) works, then your personal computer is working
and your gateway is down. Remove power to the gateway. Wait a minute.
Then apply power again. Wait a minute. Then try pinging it again. Power
off and power on will reset the gateway and often solves the networking
problem.
The (conventional) first target for ping is yourself, using your inside address.
This address is called the localhost address, and is the same for every
CHAPTER 31. BASIC POWER TOOLS 225
computer.
Exam Question 387 (p.342): What is localhost?
Acceptable Answer: Localhost is the computer you are using.
On every computer, this address will be 127.0.0.1.
Exam Question 388 (p.342): What is the IPv4 address of localhost?
Required Answer: 127.0.0.1
Following is a successful ping to the local interface. The machine is running
Ubuntu Linux. Notice that the times are very short. After the first ping,
subsequent pings are around 0.009 ms, or 9 millionths of a second. It is this
fast because the local area network is not actually involved.
Here is a failed ping to the localhost interface. The machine is running Mac
OS X. In this case, ping does work for other things, as we find out later, but
not for localhost. Because it works on other hosts, we presume it fails on
localhost because of a firewall.
Exam Question 389 (p.342): What things does a successful ping to lo-
calhost prove?
Acceptable Answer: Your network stack (software) is working.
A failed ping could mean the stack is not working, or it could mean that
ping response is firewalled. If any other pings are successful, then it is a
firewall. Try other pings before you come to a conclusion.
CHAPTER 31. BASIC POWER TOOLS 226
If all pings fail, it could be that your internal network protocol stack has
failed and you will need to reinstall your network drivers. Reinstalling is
work, so try everything else first.
Exam Question 391 (p.342): What things does a successful ping to your
own LAN address prove?
Acceptable Answer: 1. Your network stack (software) is working and 2.
your network interface hardware is working.
It does not prove that your network is working. Let’s use an analogy. All
you did is step outside, turn around, and knock on your own front door.
You did not verify that the sidewalk or street exists, or that people can get
around out there.
If ping fails to get a response from yourself, it could be that your machine
has a firewall that prevents response. Try other pings before you come to a
conclusion.
If all pings fail, it could be that your network interface card has failed and
your computer needs a hardware repair. Repairs are expensive, especially
needless ones, so try everything else first.
try that.
Exam Question 392 (p.342): What things does a successful ping to your
neighbor prove?
Acceptable Answer: 1. Your network stack (software) is working, 2.
your network interface hardware is working, 3. your network connection
(cable) is working, 4. your neighboring computer is working.
Using the same analogy as above, you step outside, walk down the street,
and knock on your neighbor’s door. If you get a response, then lots of things
must be working.
If the gateway ping is successful, then you can conclude that your network
stack is fine, and your network interface card is fine, even though they may
have failed to ping properly.
If the gateway ping is successful but the ping to localhost failed, you can
conclude that a firewall is in place, preventing the localhost pings.
Following is a successful ping to a gateway. The host machine is running
Mac OS X. The gateway is a home networking router. Notice that the times
are short, around 2 ms, or 2000 millionths of a second. It takes more time
than localhost because the local area network is involved.
A successful ping proves your network stack (software) is working and your
network interface card (hardware) is working and your cable is working
and your local area network is working. It means you do not have to test
localhost.
If ping fails to get a response from your gateway, it typically means that
your gateway has failed, or the cable between you and your gateway has
failed. It can also mean that your gateway is not accepting ping requests,
but this would be unusual because ping is such a valuable troubleshooting
tool.
CHAPTER 31. BASIC POWER TOOLS 229
Sometimes you cannot run ipconfig. It may be time to try the global
broadcast address: 255.255.255.255.
We first introduced this in section 18.1.1 (page 108).
Review section 31.2.4 (page 229). The same warnings apply here.
Exam Question 396 (p.342): What IP address is used for global broad-
cast?
Required Answer: 255.255.255.255
With the global broadcast address, ping provides much the same information
as pinging the local broadcast address, but without requiring you to know
your local address. Very handy, when it works.
Routers will generally stop global broadcasts, or any broadcasts, and restrict
them to the local area network. That is because of the mischief they could
cause in a world-wide Internet.
Beyond that, you might know the name of a web site provided by your ISP.
It is probably close to you, in network terms. Give it a try.
Beyond that, you might have some well-known sites that are always up and
running. On a typical home network, you might choose google.com.
Following is a successful ping to google.com. The host machine is running
Mac OS X. Ignoring the first ping, which is often non-typical, the later pings
are still much longer than the 3 ms we saw above. Instead they are around
CHAPTER 31. BASIC POWER TOOLS 232
75 ms, or 75,000 millionths of a second. It takes far more time than the
local router because the Internet with multiple hops is involved.
Contents
32.1 traceroute . . . . . . . . . . . . . . . . . . . . . . . 233
32.2 ftp . . . . . . . . . . . . . . . . . . . . . . . . . . . 236
32.3 telnet . . . . . . . . . . . . . . . . . . . . . . . . . . 237
32.1 traceroute
233
CHAPTER 32. INTERMEDIATE POWER TOOLS 234
macosx> google.com
traceroute: Warning: google.com has multiple addresses; using 74.125.224.178
traceroute to google.com (74.125.224.178), 64 hops max, 52 byte packets
1 192.168.1.1 (192.168.1.1) 1.799 ms 0.907 ms 0.863 ms
2 192.168.0.1 (192.168.0.1) 2.321 ms 1.843 ms 1.810 ms
3 user-10cm4g1.cable.mindspring.com (64.203.18.1) 12.768 ms 23.945 ms 12.387 ms
CHAPTER 32. INTERMEDIATE POWER TOOLS 235
32.2 ftp
ftp stands for File Transfer Protocol, and provides for (insecure) file transfer
with another computer.
http://en.wikipedia.org/wiki/Ftp has more.
Exam Question 402 (p.343): What does FTP stand for?
Required Answer: file transfer protocol
Exam Question 403 (p.343): Is FTP considered to be secure? Why?
Acceptable Answer: No. Traffic (data) is not encrypted.
Because traffic is in the clear, if it is intercepted it can be understood by
anyone listening in.
ftp is a very old protocol, one of the first implemented in the Internet. It is
widely available.
ssh, discussed in section 33.1 (page 239), presents a commonly used and
secure alternative to ftp.
Exam Question 404 (p.343): Which is more secure, ssh or ftp?
Required Answer: ssh
Exam Question 405 (p.343): Which is more widely available, ssh or ftp?
Required Answer: ftp
CHAPTER 32. INTERMEDIATE POWER TOOLS 237
32.3 telnet
Contents
33.1 ssh . . . . . . . . . . . . . . . . . . . . . . . . . . . 239
33.2 dig . . . . . . . . . . . . . . . . . . . . . . . . . . . 240
33.3 nmap . . . . . . . . . . . . . . . . . . . . . . . . . . 242
33.4 Wireshark . . . . . . . . . . . . . . . . . . . . . . . 243
These tools are a bit more advanced than the basic tools of the previous
chapter. They are more advanced in the sense that fewer people know them,
or they rely on advanced features such as encryption.
ssh is introduced in 33.1 (page 239).
dig is introduced in 33.2 (page 240).
nmap is introduced in 33.3 (page 242).
Wireshark is introduced in 33.4 (page 243).
33.1 ssh
The first s in ssh stands for secure. All data between two computers is
encrypted if it goes through an ssh connection.
ssh provides a secure shell (command line) connection with another com-
puter. It also has the ability to securely copy files. In fact, ssh provides
several other capabilities, making it an entire suite of tools.
239
CHAPTER 33. ADVANCED POWER TOOLS 240
33.2 dig
The dig command is a DNS (domain name system) lookup utility. It tra-
verses the DNS system and reports the IP address or addresses of the re-
quested domain name. It also reports the authority by which it came to
that conclusion.
http://en.wikipedia.org/wiki/Domain_Information_Groper has more
information about the dig command.
The nslookup command is similar to the dig command.
Exam Question 417 (p.344): Which is more current, nslookup or dig?
Required Answer: dig
nslookup has been deprecated in favor of dig.
Exam Question 418 (p.344): What does deprecated mean?
Acceptable Answer: being phased out
Deprecated means the old way of doing things, and that the old way is in
the process of being replaced by something better. When something has
been deprecated, it should not be used or relied upon. Something better
has replaced it. But just removing the old thing would frustrate people and
cause other programs to break. Therefore, deprecated things are often kept
CHAPTER 33. ADVANCED POWER TOOLS 241
around for many years. This gives people time to update their use of the
old item.
Deprecated does not mean that it has been phased out. It is not gone yet.
It is still usable. But it is being phased out, and you should assume that
some day it will simply be gone.
Things are deprecated because the newer thing is substantially better, and
there will be no loss when the old thing is gone.
Deprecated things still often show up on exams, partly because the exam
has not been updated, and partly because some historical knowledge can be
helpful.
Here is an example using dig against n101.doncolton.com.
;; QUESTION SECTION:
;n101.doncolton.com. IN A
;; ANSWER SECTION:
n101.doncolton.com. 10120 IN A 69.89.31.217
;; AUTHORITY SECTION:
doncolton.com. 78192 IN NS ns1.bluehost.com.
doncolton.com. 78192 IN NS ns2.bluehost.com.
33.3 nmap
Broadcast ping is discussed in section 31.2.4 (page 229). There we see a way
that frequently works to discover what other devices are sharing the same
local area network with you.
nmap goes this one better. In addition to finding the IP addresses of those
other devices, it can probe to find the ports that are open. An open port
means a service that is being provided.
http://en.wikipedia.org/wiki/Nmap has more.
http://nmap.org/download.html has free downloads for Windows, Mac,
and Linux.
Here is an example scan of my home network.
The first host is my router. It supports telnet, dns, and http.
The second host is the laptop computer from which I issued the command.
It supports several more services.
The third host is an Apple iPod Touch. The only service it supports is one
for synchronization.
But there’s more. Using the -A command-line option, nmap can probe
the ports with various special requests and can analyze their responses. The
result of the analysis is a more detailed look into the nature of that machine.
Here is an example scan of my home router.
33.4 Wireshark
Switching
245
Chapter 34
Overview of Switching
Contents
34.1 Topologies . . . . . . . . . . . . . . . . . . . . . . . 246
34.2 Collision Domains . . . . . . . . . . . . . . . . . . 247
34.3 Half Duplex . . . . . . . . . . . . . . . . . . . . . . 248
34.4 Dividing Collision Domains . . . . . . . . . . . . 249
34.5 Counting Collision Domains . . . . . . . . . . . . 249
34.6 From Bus To Star . . . . . . . . . . . . . . . . . . 250
34.7 Broadcast Domains . . . . . . . . . . . . . . . . . 250
34.1 Topologies
Topology means the way devices are connected among themselves to create
a network. Who is your neighbor, or neighbors?
Star: The most popular topology for wired local area networks is called the
star topology. At the center of the star is a switch, and at the end of each
ray is a computer. It is popular because of simplicity and fast speeds.
Bus: Years ago the most popular topology for wired networks was the
bus topology because of its low cost. A single wire goes from computer to
computer, like a road around an island. Omnibus means “for all,” or shared,
or combined. It is the main topology for wireless networks because devices
all share the same radio frequency bandwidth.
246
CHAPTER 34. OVERVIEW OF SWITCHING 247
Mesh: This is the most popular topology for connecting several LANs.
Each node of the network can connect to a few or many other nodes. The
human brain uses a mesh topology where nerve cells can connect to many
other nerve cells. High performance parallel processing computers use mesh
to connect the individual CPU cores.
Exam Question 421 (p.344): List in any order the three main network
topologies in use today.
Acceptable Answer: star, bus, mesh
Keeping costs low is always important. Voltage on copper is one of the least
expensive types of physical media to utilize. And using a bus topology also
saves money.
To communicate in this setting, a computer would transmit its message as
voltages on the shared wire. Other computers would sense the voltages and
recognize them as a message. They would make a copy of the message and
then decide whether it was for them or not.
But there could be collisions. What if two computers talk at almost the
same time? New rule: a computer would first listen to the wire. If the
wire was quiet, it would start sending its message. It would also listen just
in case some other computer started talking at about the same time. It
would sense the voltages on the wire. If another machine started talking,
the voltages would overlap each other creating higher peaks than normal.
Those higher peaks would be recognized as a collision, and the computer
would stop talking. The other computer would also detect the collision and
it would stop talking too.
Exam Question 422 (p.344): What is a collision?
Acceptable Answer: two devices talking at the same time on the same
media
The solution was to back off and wait some random amount of time and try
again. This generally ended the conflict. One computer would randomly
talk first. The other would wait and then talk next. If there was another
collision, they would wait again, this time longer.
The shared wire is called a collision domain. It is the set of places where two
devices are not allowed to talk at the same time. It is also the set of places
CHAPTER 34. OVERVIEW OF SWITCHING 248
where every computer can hear every message from every other computer.
Exam Question 423 (p.344): What is a Collision Domain?
Acceptable Answer: shared physical media
The physical medium includes the full extent to which signals can propogate,
including passing through layer 1 hubs and repeaters.
Normally we worry about collision domains that have lots of hosts sharing
the same medium, but technically it is still a collision domain even if there
are only one or two hosts.
Exam Question 424 (p.344): How do you break up a Collision Domain?
Acceptable Answer: insert switches to make separate segments
In wireless (Wi-Fi) settings, collision domains can be large. This is a prob-
lem.
In wired settings, collision domains are less of a problem. That is because
switches are commonly used instead of hubs, and full-duplex, star-topology
wiring is commonly used instead of bus-topology wiring.
We use the words “half duplex” to say that a channel can send or receive but
not both at the same time. For example, a residential driveway is typically
half duplex.
Exam Question 425 (p.344): What does half duplex mean?
Acceptable Answer: can send or receive but not at the same time
We use the words “full duplex” to say that a channel can go both ways at
the same time. For example, a two-lane road is full duplex.
Exam Question 426 (p.344): What does full duplex mean?
Acceptable Answer: can send and receive at the same time
With bus topology, communication could only be half duplex because there
was really only one channel.
With star topology, communication can be faster because fewer devices are
on each channel, and with proper wiring full duplex becomes possible.
CHAPTER 34. OVERVIEW OF SWITCHING 249
As computers got faster their communication needs also got bigger and the
wires got more busy. They often reached a point where there was so much
traffic that you would get a traffic jam. Think of a room with two people
talking. Now add more people until you can barely carry on a conversation.
That was the collision domain problem.
The next step forward was to separate large collision domains into smaller
pieces. You could split it into two pieces by using a bridge. The bridge
would listen to each message and copy it to the other segment and send it
out again. Bridges broke down collision domains and they also extended
the range of the network. Without a bridge, the maximum wire length was
something like 100 meters. But with a bridge, you could get 100 meters per
segment.
If you have a smart enough bridge, it remembers the MAC address of each
device on each side of the bridge. If the destination was on the other side
of the bridge, it would copy it across. If not, it would not copy it. This cut
down on network traffic on both sides.
An important feature of communication is the so-called 80-20 rule, which
applies to many things in life and nature. This rule says that 80 percent of
your communication will be with 20 percent of your neighbors. Obviously
the numbers 80 and 20 are not precise, but they indicate the direction that
things happen.
If you could segregate the devices wisely, you could make sure that the 20
percent of popular neighbors were on the same network segment as yourself.
Instead of using a bridge, you could use a switch and have lots of segments.
Direct communication is used when we know the exact address of our des-
tination. Sometimes we do not know the address. Examples include DHCP
and ARP.
Exam Question 427 (p.344): List in any order two protocols that use
broadcast in a LAN.
Acceptable Answer: dhcp, arp
CHAPTER 34. OVERVIEW OF SWITCHING 251
Plan B: Redundancy
Contents
35.1 Spanning Tree Allows Redundancy . . . . . . . . 253
35.2 Convergence . . . . . . . . . . . . . . . . . . . . . 253
35.3 Step One: Switches Elect A Leader . . . . . . . 254
35.4 Step Two: Switches Identify Best Paths . . . . . 255
35.5 Step Three: Traffic Resumes . . . . . . . . . . . . 255
35.6 RSTP Is Faster . . . . . . . . . . . . . . . . . . . . 256
252
CHAPTER 35. PLAN B: REDUNDANCY 253
Imagine that computer A sends a broadcast. It goes to its switch, call it S1.
S1 is smart enough to send it out on all the other ports, but not back to A.
Down one of those lines is another switch, S2, and down another line is S3.
And for redundancy S2 and S3 also have a direct connection to each other.
So the message goes from A to S1, and from S1 to both S2 and S3. And
from S2 to S3 (again). And from S3 to S2 (again). Soon the message is
running in circles.
Broadcast Storm: We call this situation a broadcast storm. It will happen
whenever switches are connected in a loop. Switches cannot remember every
message they have seen before. They simply pass every broadcast forward
to all the other switches.
The solution is to break the loop by disconnecting one of the wires so the
network becomes a “tree” without loops. Guess who had to do that? The
network administrator. The broadcast storm ends. And you lose your re-
dundancy.
The tree thing is very important. What if switches could be made to au-
tomatically disable certain links, turning any net into a tree? Then redun-
dancy could exist in switching networks. In that case, if a link went down
the network could heal itself. Redundant links make the network stronger
and more reliable.
The solution is an algorithm called the Spanning Tree Protocol (STP).
This protocol is a set of steps followed by switches to let them do just what
we want: automatically disable redundant links until they are needed.
Exam Question 433 (p.345): What does STP stand for?
Acceptable Answer: spanning tree protocol
35.2 Convergence
The first thing STP does is elect a root bridge. It becomes the center of
everything, the root of the tree. Links that would create loops get blocked.
Exam Question 436 (p.345): Which switch is the root bridge?
Acceptable Answer: lowest bridge id
The switch with the lowest bridge ID will become the root. The bridge ID
has two parts: bridge priority and MAC address. Priority is the important
thing. MAC address is only used as a tie-breaker when two switches have
the same priority. The bridge priority defaults to 32768 but can be changed
by the network administrator. Because the network administrator can set
the bridge priority, they can control the root bridge election.
Normally the network administrator wants the switch that is closest to the
router to be the root bridge.
CHAPTER 35. PLAN B: REDUNDANCY 255
After the root bridge is agreed upon, each other switch must decide which
of its ports provides the best path to that root bridge. Best is defined as
having the least cost, which means the fastest speed. That port becomes
the root port for the switch.
Exam Question 437 (p.345): Which port is the root port?
Acceptable Answer: least cost path to root bridge
The network administrator can manually disable a port. Disabled ports are
never part of the spanning tree. The other ports can become members of
the spanning tree.
We do not really want to manually disable any ports. We want the STP
protocol to disable them as needed. Then, as needed, STP can re-enable
ports to heal a broken network. Manually disabled ports cannot be re-
enabled by STP. They must be manually re-enabled. This means a network
administrator must get directly involved.
Exam Question 438 (p.345): List in any order classic STP’s four port
state options.
Acceptable Answer: forwarding, learning, listening, blocking
Under the classic STP protocol, each non-disabled port of each switch is in
one of the following four states:
Forwarding: This port is a member of the tree. All ports on access routers
are forwarding ports.
Learning: This port has decided to become a member of the tree but does
not have enough information to be useful, so it just listens and learns about
the network.
Listening: This port is deciding whether or not to become a member of
the tree. It has not yet decided.
Blocking: This port decided that joining the tree would create a loop.
As mentioned above, during convergence all routine traffic must wait. When
convergence is achieved, routine traffic resumes.
CHAPTER 35. PLAN B: REDUNDANCY 256
Routing
257
Chapter 36
Review of Routing
Contents
36.1 Routing Packets Between LANs . . . . . . . . . 258
36.2 Anatomy of a Hop . . . . . . . . . . . . . . . . . . 259
36.3 Time To Live . . . . . . . . . . . . . . . . . . . . . 259
36.4 Trace Route . . . . . . . . . . . . . . . . . . . . . . 260
258
CHAPTER 36. REVIEW OF ROUTING 259
destination.
Exam Question 441 (p.345): What is a hop?
Acceptable Answer: moving a packet from one lan to the next lan
The router must send the packet on its next hop toward its ultimate desti-
nation. To do this, each router must belong to two or more LANs.
Routers talk to their neighboring routers. They learn what networks each
one can reach. This enables them to pick the best direction for the next
hop.
Because TTL reports the location of death, a clever use of this information
gives us a list of routers through which a packet will travel to its destination.
This information can be helpful in debugging problem situations. It can be
used to discover where the bottlenecks or routing errors might be occurring.
The Trace Route command (traceroute or tracert) sends several packets
with a TTL value of 1. As those die, the location of death is sent back to
the trace route program. It sends several more with a TTL value of 2 and
records their deaths. It continues increasing the TTL value until the final
destination is reached.
http://en.wikipedia.org/wiki/Traceroute provides an overview.
Exam Question 444 (p.345): List the two main things that traceroute
reports.
Acceptable Answer: identity and latency for each router in the path
Traceroute also lists the number of hops to get to each router, and the
percentage of packet loss (expected responses not received).
Chapter 37
Contents
37.1 Constant Netmasks . . . . . . . . . . . . . . . . . 261
37.2 Implicit Netmasks: Classful Addressing . . . . . 262
37.3 Explicit Netmasks: Classless, CIDR, VLSM . . 263
Internet Protocol (IP) addresses are logical addresses rather than physical
addresses. MAC addresses are the physical addresses used in Ethernet.
IP addresses consist of a number of bits. The first part of the address
identifies the network or subnet. The rest of the address identifies the host.
The location of the dividing line is called the netmask and has changed over
the years.
In section 27.4 (page 183) we looked at pre-1981 addressing. We talked
briefly about core routers and hand-crafted routing tables.
With pre-1981 addressing, the 32-bit IP address was divided into two parts:
the network and the host. The network part was always 8 bits. The host
part was always 24 bits.
261
CHAPTER 37. NETMASKS AND ADDRESSING 262
Classful Addressing came next. Instead of always having 8 bits for the
network, the number depended on the address class. The netmask itself was
not stated, but it was implied by the first few bits of the IP address.
Exam Question 445 (p.345): Class A addresses start with what bit(s)?
Required Answer: 0
Exam Question 446 (p.345): Class A addresses have what netmask?
Acceptable Answer: /8
Class A corresponds to IP addresses from 0.x.x.x through 127.x.x.x.
With Class A addresses, the network portion is 8 bits and the host portion
is 24 bits. This is exactly the same as the legacy pre-1981 system, making
the Classful Addressing approach backward compatible with the pre-1981
system.
Exam Question 447 (p.346): Class B addresses start with what bit(s)?
Required Answer: 10
Exam Question 448 (p.346): Class B addresses have what netmask?
Acceptable Answer: /16
Class B corresponds to IP addresses from 128.x.x.x through 191.x.x.x.
With Class B addresses, the network portion is 16 bits and the host portion
is 16 bits.
Exam Question 449 (p.346): Class C addresses start with what bit(s)?
Required Answer: 110
Exam Question 450 (p.346): Class C addresses have what netmask?
Acceptable Answer: /24
Class C corresponds to IP addresses from 192.x.x.x through 223.x.x.x.
With Class C addresses, the network portion is 24 bits and the host portion
is 8 bits.
There are two other classes. Class D addresses start with the bits 1110. It
is for multicast use. Class E addresses start with the bits 1111. It is for
experimental use.
CHAPTER 37. NETMASKS AND ADDRESSING 263
Types of Routers
Contents
38.1 Core, Distribution, and Access . . . . . . . . . . 264
38.2 Autonomous Systems . . . . . . . . . . . . . . . . 265
38.3 Living On The Edge . . . . . . . . . . . . . . . . . 266
38.4 User Sends A Packet . . . . . . . . . . . . . . . . 266
38.4.1 Sending Inside . . . . . . . . . . . . . . . . . . . . 267
38.4.2 Sending Outside . . . . . . . . . . . . . . . . . . . 267
38.4.3 The Role of NAT . . . . . . . . . . . . . . . . . . . 268
38.5 User Receives A Packet . . . . . . . . . . . . . . . 268
38.5.1 Continuing A Conversation . . . . . . . . . . . . . 268
38.5.2 Starting A Conversation . . . . . . . . . . . . . . . 269
38.5.3 Defeating Hackers . . . . . . . . . . . . . . . . . . 269
38.6 Daisy Chaining Access Routers . . . . . . . . . . 269
38.6.1 Two Router Systems . . . . . . . . . . . . . . . . . 270
38.6.2 What Could Go Wrong? . . . . . . . . . . . . . . . 270
264
CHAPTER 38. TYPES OF ROUTERS 265
IGPs. IGPs are further divided into distance-vector and link-state protocols.
One well-known distance-vector example is RIP. Some well-known link-
state examples are EIGRP, OSPF, and IS-IS.
IGPs are used mostly by distribution layer routers.
The routing protocols used between autonomous systems are called exterior
gateway protocols. The most important example is BGP, the Border
Gateway Protocol.
Access routers form the outer edge of the Internet. These routers tend to
be very simple and inexpensive. They reach downward to a single local
area network with a few or many host computers and one or more switches.
They reach upward to a more powerful distribution router that handles
many access routers.
Because they are on the edge their routing decisions are very simple. They
spend most of their time doing NAT rather than actually routing. They are
often called gateway routers. Gates only have two sides: the inside and the
outside.
Home and small office routers fall into this category. They only talk to one
other router which is their “uplink.” Their downlink is to a switch that is
the root bridge (and often the only bridge) of a local area network of end
users. Home routers also typically provide Wi-Fi, DHCP, and NAT. A home
router usually has one uplink and four downlinks.
When a computer uses DHCP to find out about its network, one piece of
information it gets is the gateway address. That is the address of the router
that serves as the gateway to networks beyond the local one.
When the source computer has information to send the information goes
down the OSI stack from application to presentation to session to transport
to the network layer. The information is divided into a series of packets. At
this point the netmask (or subnet mask) becomes important.
CHAPTER 38. TYPES OF ROUTERS 267
If the destination is within the same LAN as the source, the packet is sent
directly, without the use of a router. The source computer uses ARP if
necessary to discover the MAC address of the destination. It uses that to
build a frame for the packet and it sends the bits out on the physical medium.
This would be the case for things like a local network printer, or a home
media server, or video surveillance cameras. As we get more into the Internet
of Things (IoT), there will be more things in the local area network.
Exam Question 456 (p.346): When does a computer send a frame directly
to its destination?
Acceptable Answer: destination is in same lan
We don’t pay for home internet so we can print to our local printer. We
want content from websites or Netflix or Google. And that is outside of our
local area network.
If the destination is not within the same LAN as the source, the packet is
sent to the router using the gateway address. The source computer uses
ARP if necessary to discover the MAC address of the gateway. It uses that
to build a frame for the packet and it sends the bits out on the physical
medium.
Exam Question 457 (p.346): When does a computer send a frame directly
to the gateway?
Acceptable Answer: destination is not in same lan
Exam Question 458 (p.346): What does a gateway do?
Acceptable Answer: provide access to other networks
Exam Question 459 (p.346): If the router’s IP address is 1.2.3.4, what is
CHAPTER 38. TYPES OF ROUTERS 268
the most likely value for the gateway address in that LAN?
Acceptable Answer: 1.2.3.4
The gateway address sent by DHCP is actually just the router’s IP address
in that LAN.
After the traffic arrives at the router, typically network address transla-
tion (NAT) takes place because the inside computers do not have routable
addresses, but the router itself does. So the router makes a note in its NAT
table telling which device and which port is sending the message. It then
substitutes its own IP address and makes up a port number, slaps them on
the packet, and sends them through the uplink.
Exam Question 460 (p.346): What does NAT stand for?
Required Answer: network address translation
Exam Question 461 (p.346): What does NAT do?
Acceptable Answer: replace one ip address with another
Normally (but not always) NAT is replacing a non-routable address with a
routable address.
If the port number is not forwarded or in the NAT table, the message is
dropped. In this way NAT acts as a simple firewall. Because there are
65536 possible port numbers, but only a small number of those are in the
NAT table, the hacker’s odds of guessing correctly are pretty small.
Exam Question 462 (p.346): How does NAT defend against attacks on
local computers?
Acceptable Answer: outsiders cannot start conversations with locals
Children sometimes pick flowers and weave them into necklaces. Daisies are
popular for this activity, and the weaves are sometimes called daisy chains.
That term has been adopted into networking and other parts of the comput-
ing world. Daisy chaining means linking one thing to another, to another,
to another, possibly many links long.
In our present discussion, we can say that it is possible to have a collection
of access routers, just like branches or rootlets of a tree. The key feature is
that there is only one path up through each router in that network. Loops
are not possible. And access routers work great.
The decision of whether to daisy chain several access routers together, or
to have a distribution router talk to several access routers, is really more of
an economic decision. Distribution routers are more expensive and powerful
than access routers. Sometimes an access router is good enough.
With a cascade of several access routers, it could be that a packet from
CHAPTER 38. TYPES OF ROUTERS 270
outside reaches the first access router, and that router updates the address
and port number, sending it along its way. The router presumes (but does
not really care) that the packet is going directly to its final destination. But
what if that destination is not the final destination after all? What if it is
yet another access router with yet another NAT table? It could happen. In
fact, it is fairly common.
The truth is, we don’t know, and probably cannot easily tell, how many times
NAT has been applied to a packet. We just know that like the breadcrumbs
in the Hansel and Gretel fairy tale, the routers provide a path that leads
back to the ultimate client.
Let’s say you want to share your Internet connection. Perhaps you have
roommates or guests and you, being a nice guy, are happy to help them out.
But at the same time you know that devices inside your LAN are not subject
to the firewall provided by NAT. Somebody could hack your computer. You
want to avoid that.
There is a two-router solution. You can place one access/gateway router at
the front door of your system. It talks to the Internet, and it provides a
connection to guests and roommates. It provides the shared network.
It also provides a connection to your private subnet. That is where the sec-
ond access/gateway router comes in. Your computer sits inside the private
subnet. And your private devices, like your laser printer and your media
server sit inside your private subnet.
Some routers support guest networks automatically. You may not need two
routers to achieve the same results.
same default addressing. But for routing to happen the subnets must have
different network numbers. That means that somebody must configure one
of the routers to have a different IP address range. And anytime you are
doing configuration, it is scary to the average person.
Exam Question 463 (p.346): What happens when both LANs for the
router have the same network number?
Acceptable Answer: traffic will not get through
Chapter 39
Distribution Routers
Contents
39.1 Routing Tables . . . . . . . . . . . . . . . . . . . . 272
39.2 Route Aggregation . . . . . . . . . . . . . . . . . 273
39.3 Longest First . . . . . . . . . . . . . . . . . . . . . 274
272
CHAPTER 39. DISTRIBUTION ROUTERS 273
Maybe all the traffic for 2.4.7 should also go through port 3. The table
might look like this instead:
Address Mask Port
2.4.6.0 24 3
2.4.7.0 24 3
0.0.0.0 0 1
The table can be pretty big. Its size is really only limited by the available
memory in the router and the speed of the processor in the router. But both
of those things cost money, so they tend to be small in ordinary routers.
Dotted Quad Binary
2.4.6.0 00000010.00000100.00000110.00000000
2.4.7.0 00000010.00000100.00000111.00000000
Notice that the first 23 bits of both networks are identical. Only the last
bit differs. Because the IP addresses are similar and the port is the same,
so we can aggregate the routes like this:
Address Mask Port
2.4.6.0 23 3
0.0.0.0 0 1
The 23 means to check the first 23 bits of the destination, and if it matches
the first 23 bits of 2.4.6.0, then send it through port 3.
Route aggregation is the hugely important, and pretty obvious, solution to
CHAPTER 39. DISTRIBUTION ROUTERS 274
When a packet comes in, the router looks at the destination address and
makes a decision about which line in the routing table should be used.
The rule is to use the line with the longest prefix. Thus, a /24 line would
be used before a /23 line, and the /0 line would be used last of all.
Chapter 40
Contents
40.1 Network Diagram . . . . . . . . . . . . . . . . . . 276
40.2 Typical Access Network . . . . . . . . . . . . . . 276
40.3 Two Access Networks . . . . . . . . . . . . . . . . 277
40.4 Two Distribution Networks . . . . . . . . . . . . 278
40.5 Direct Knowledge . . . . . . . . . . . . . . . . . . 280
Access routers do not need complex routing tables. They do not converse
among themselves. They have no redundancy. If an access router goes out,
a workgroup drops off the network. They may be down for a few hours. The
solution is to throw in a new router and everything is back up and running.
Being a single point of failure for a workgroup is fine.
Above the workgroup level, when many workgroups are involved, it becomes
valuable to have redundancy to avoid having any single point of failure.
With all that redundancy the routing tables for distribution layer routers
can become pretty complex so we want them to be managed automatically,
not by hand. We do this by using Routing Protocols to manage the routing
tables.
The first widely used routing protocol was RIP, the Routing Information
Protocol. It came out in 1988.
Exam Question 465 (p.347): List the two big advantages of RIP.
Acceptable Answer: widely supported, easy to configure
The basis of this protocol is two things. First, each router knows what
275
CHAPTER 40. ROUTING TABLE EXAMPLE 276
networks it is directly connected to. Second, each router can share what it
knows with its neighbors.
This is a simple-minded but very effective approach. And because it has
been around so long, many routers speak this language.
We will use a network diagram to illustrate what we are talking about. Here
are some symbols.
A typical access network has an access router with a built-in switch. Here we
show it connected on the left to the cloud through the ISP (internet service
provider) and on the right to the local area network of office or household
computers.
CHAPTER 40. ROUTING TABLE EXAMPLE 277
N01 N11
Internet
R1 S1
We have two local area networks here: N01 and N11. The N01 network is
owned by the ISP. The uplink port of the R1 router belongs to the N01 net-
work. The N11 network is owned by the office or household. The downlink
port of the R1 router belongs to the N11 network. The S1 switch belongs to
the N11 network. All devices in the workgroup belong to the N11 network.
Access Routing Table
Every network needs an IP address range and a network (or subnet) mask.
Let’s give the N11 network this address: 1.1.1.0/24. For the N01 network
we will just use 0.0.0.0/0, the route that matches everything. 0.0.0.0/0 is
also called the default route, or the route of last resort. The R1 router has
the following routing table.
Address Port
0.0.0.0/0 0
1.1.1.0/24 1
When any traffic arrives at the router, it will consult its table.
The router always uses the most narrowly specified route that it can. And
the bigger the CIDR number, the more narrowly specified the route is. In
this case the first choice is /24.
Traffic with a destination in 1.1.1.0/24 will be sent through port 1.
All remaining traffic has a destination in 0.0.0.0/0 and will be sent through
port 0.
N11
N01
R1 S1
Internet
N22
N02
R2 S2
This is pretty similar to the previous network. We have four local area
networks here: N01, N11, N02, and N22. The N01 and N02 networks are
owned by the ISP. The N11 and N22 networks are each owned by an office
or household.
The uplink port of the R1 router belongs to the N01 network. The downlink
port of the R1 router belongs to the N11 network. The S1 switch and its
associated workgroup belong to the N11 network.
The uplink port of the R2 router belongs to the N02 network. The downlink
port of the R2 router belongs to the N22 network. The S2 switch and its
associated workgroup belong to the N22 network.
When traffic wants to go from the N11 network to the N22 network, it must
go through the R1 router, then through the Internet, then through the R2
router, and then into the N22 network.
Now we will go beyond access routers. We will let the routers talk to each
other directly without going through the Internet. For this to happen, the
routers must have more than just two ports and the owners of R1 and R2
must create a physical connection between the routers. This router-to-router
connection is in its own local area network, a two-device network.
CHAPTER 40. ROUTING TABLE EXAMPLE 279
N11
N01
R1 S1
Internet N12
N22
N02
R2 S2
Again, this is similar to the previous example. But here we have five local
area networks, including a new one labeled N12.
When traffic wants to go from the N11 network to the N22 network, it must
go through the R1 router, then it can go directly through the R2 router, and
then into the N22 network. This cuts down on traffic to the Internet. ISPs
often bill based on the amount of traffic that goes through their connection,
so having a direct connection can be a cost savings.
To make this happen, we must update the routing tables.
Let’s assume that the N11 network is 1.1.1.0/24.
Let’s assume that the N22 network is 2.2.2.0/24.
For the R1 router, the new routing table will look something like this:
Address Port
0.0.0.0/0 0
1.1.1.0/24 1
2.2.2.0/24 2
When any traffic arrives at the router, it will consult its table. For traffic
that has a destination matching 1.1.1.0/24 (which is the N11 network) it will
send the traffic through port 1. For traffic that has a destination matching
2.2.2.0/24 (which is the N22 network) it will send the traffic through port 2.
Otherwise, for traffic that has a destination matching 0.0.0.0/0, it will send
the traffic through port 0.
CHAPTER 40. ROUTING TABLE EXAMPLE 280
Routers have to know directly about each LAN to which they are connected.
Access routers may learn about their uplink through DHCP provided by
their uplink. They learn about their downlink by being manually configured
by a network administrator.
Distribution routers typically learn all their direct knowledge from configu-
ration information provided by the network administrator.
What about the 2.2.2.0 entry in the table above? It is not direct knowledge.
Address Port
2.2.2.0/24 2
R1 has no direct knowledge of the 2.2.2.0 network. This information was
given to it by the network administrator as a hand-coded “static route.”
When networks are small, it is very reasonable to use hand-crafted static
routes to tell the routers how to do their jobs. But networks get big and
network administrators wisely want to avoid tedious and error-prone aspects
of their jobs. That is why routing protocols were invented. We want to insert
the 2.2.2.0 entry into the routing table automatically, not by hand. That is
called “dynamic routing.”
Chapter 41
Contents
41.1 Distance-Vector Routing . . . . . . . . . . . . . . 283
41.2 Naı̈ve Routing Problem . . . . . . . . . . . . . . . 285
41.3 Split Horizon . . . . . . . . . . . . . . . . . . . . . 286
41.4 Thrashing . . . . . . . . . . . . . . . . . . . . . . . 287
41.5 Route Poisoning . . . . . . . . . . . . . . . . . . . 288
41.6 RIP Timers . . . . . . . . . . . . . . . . . . . . . . 288
41.7 Holddown . . . . . . . . . . . . . . . . . . . . . . . 289
41.8 RIP Summary . . . . . . . . . . . . . . . . . . . . 290
41.9 RIPv2 . . . . . . . . . . . . . . . . . . . . . . . . . 290
Building upon our example from the previous chapter, we now come to RIP,
the Routing Information Protocol, the first major routing protocol. Because
it is first, it is important to understand.
Exam Question 466 (p.347): What does RIP stand for?
Acceptable Answer: routing information protocol
With RIP, the routers talk to each other. Every 30 seconds or so, each
router sends a message to all of its direct neighbors giving them a copy of
its routing table. These messages are called advertisements.
Those neighbor routers will look at the routing table to discover local area
networks that can be reached by going through the first router.
281
CHAPTER 41. RIP: ROUTING INFORMATION PROTOCOL 282
In this way, R2 learns that through R1 it can reach 1.1.1.0/24, and R1 learns
that through R2 it can reach 2.2.2.0/24.
These are our networks:
Network Address
N12 9.1.2.0/30
N11 1.1.1.0/24
N22 2.2.2.0/24
Before the first advertisement, the routing tables look like this:
R1 Routing Table R2 Routing Table
Address Port Address Port
0.0.0.0/0 0 0.0.0.0/0 0
1.1.1.0/24 1 2.2.2.0/24 1
9.1.2.0/30 2 9.1.2.0/30 2
After the first advertisement, with the new information merged in, the rout-
ing tables look like this:
R1 Routing Table R2 Routing Table
Address Port Address Port
0.0.0.0/0 0 0.0.0.0/0 0
1.1.1.0/24 1 2.2.2.0/24 1
9.1.2.0/30 2 9.1.2.0/30 2
0.0.0.0/0 2 0.0.0.0/0 2
2.2.2.0/24 2 1.1.1.0/24 2
9.1.2.0/30 2 9.1.2.0/30 2
In these tables we are using bold type to show the information each router
has just learned from the advertisement. Notice that the 9.1.2.0/30 entries
are duplicates of something already in the table so they are not actually
re-added. Instead, we have this.
R1 Routing Table R2 Routing Table
Address Port Address Port
0.0.0.0/0 0 0.0.0.0/0 0
1.1.1.0/24 1 2.2.2.0/24 1
9.1.2.0/30 2 9.1.2.0/30 2
0.0.0.0/0 2 0.0.0.0/0 2
2.2.2.0/24 2 1.1.1.0/24 2
When we receive an advertisement, we merge the networks into our routing
table so long as the advertisement provides a different route (port number)
CHAPTER 41. RIP: ROUTING INFORMATION PROTOCOL 283
The first trick is fairly simple, actually. It is called Split Horizon. The
concept here is that anything the R2 router learned from the R1 router
should never be advertised back to the R1 router. It would be redundant
because R1 already knows it, and R1 is one step closer to the truth.
So, we only advertise things we learned from other sources.
Here are the new starting tables. They include the source port number
through which we learned the information. P = port, H = hops, Src =
source. We use * to indicate direct knowledge.
R1 Routing Table R2 Routing Table
Address P H Src Address P H Src
1.1.1.0/24 1 0 * 2.2.2.0/24 1 0 *
9.1.2.0/30 2 0 * 9.1.2.0/30 2 0 *
0.0.0.0/0 0 0 * 0.0.0.0/0 0 0 *
After the first advertisement, we have these updated routing tables.
R1 Routing Table R2 Routing Table
Address P H Src Address P H Src
1.1.1.0/24 1 0 * 2.2.2.0/24 1 0 *
9.1.2.0/30 2 0 * 9.1.2.0/30 2 0 *
0.0.0.0/0 0 0 * 0.0.0.0/0 0 0 *
2.2.2.0/24 2 1 2 1.1.1.0/24 2 1 2
0.0.0.0/0 2 1 2 0.0.0.0/0 2 1 2
So far, so good. Now the big test. What happens after the second adver-
tisement?
CHAPTER 41. RIP: ROUTING INFORMATION PROTOCOL 287
41.4 Thrashing
But what if the route that was poisoned really comes back? With phone
numbers that was unlikely. If a number stops working, it usually stays that
way. But with networking a link may go down for a while due to power
outage or broken wire and later it gets fixed.
We need a way to avoid thrashing and yet let routes be reinstated.
CHAPTER 41. RIP: ROUTING INFORMATION PROTOCOL 289
To do this RIP uses four timers: Update, Invalid, Holddown, and Flush.
Update Timer: Usually 30 seconds, when it expires, the router sends an
update to all neighboring routers, giving the routing information that it
knows.
Invalid Timer (Expiration Timer): Usually 180 seconds. For each route
in the table, this timer is reset to 180 when an update comes in that reaffirms
the route. If no update reaffirms the route by the time this timer counts
down to zero, the router concludes that the route is invalid.
Flush Timer: Usually 240 seconds. After being marked invalid, the router
advertises to its neighbors that the route is invalid. This is called route
poisoning. It does this for 60 seconds (two update cycles). But if no
update reinstates the route, it is dropped from the routing table when the
flush timer reaches zero.
Holddown Timer (Cisco): Usually 180 seconds. When a route update
advertises a higher distance than it had before, a holddown goes into effect.
This higher distance could be valid, but it often means the network is not
stable. To restore stability, no updates are accepted for this route until the
holddown expires. This lets route poisoning do its job.
41.7 Holddown
41.9 RIPv2
RIP, aka RIPv1, does not support explicit subnet masks. It just works
with the implicit network masks that ruled the day before CIDR became
popular. RIP2, aka RIPv2, fixes that problem. RIP2 supports CIDR and
explicit subnet masking and makes other improvements.
Chapter 42
Link-State Routing
Contents
42.1 Link-State Advertisements . . . . . . . . . . . . . 292
42.2 Routing Tables . . . . . . . . . . . . . . . . . . . . 293
42.3 EIGRP . . . . . . . . . . . . . . . . . . . . . . . . . 293
42.4 OSPF . . . . . . . . . . . . . . . . . . . . . . . . . 294
42.5 IS-IS . . . . . . . . . . . . . . . . . . . . . . . . . . 294
42.6 Further Study . . . . . . . . . . . . . . . . . . . . 294
291
CHAPTER 42. LINK-STATE ROUTING 292
42.3 EIGRP
42.4 OSPF
42.5 IS-IS
IPv6
295
Chapter 43
IPv6 Addressing
Contents
43.1 Why Should Anyone Care? . . . . . . . . . . . . 296
43.2 If IPv6 Is So Great, Why Is IPv4 Still Used? . 297
43.3 Am I Already Using IPv6? . . . . . . . . . . . . . 298
43.4 Alternate Paths . . . . . . . . . . . . . . . . . . . 298
43.5 What Devices Are Involved? . . . . . . . . . . . 299
43.6 Getting an IPv6 Address . . . . . . . . . . . . . . 300
43.7 Privacy and Security . . . . . . . . . . . . . . . . 301
43.8 IoT: The Internet of Things . . . . . . . . . . . . 301
43.9 Technical Details . . . . . . . . . . . . . . . . . . . 302
43.10Address Abbreviation . . . . . . . . . . . . . . . . 303
43.11Subnets . . . . . . . . . . . . . . . . . . . . . . . . 305
296
CHAPTER 43. IPV6 ADDRESSING 297
There are groups of people that say IPv6 is the wave of the future and
anyone who clings to IPv4 is misguided and stuck in the past. Maybe. If
you just read articles from the same “echo chamber,” you may end up with
a mistaken impression of reality. Be alert.
There is a saying that you cannot teach an old dog new tricks. People tend
to stick with whatever has worked in the past, and they are reluctant to
learn new things unless there is a substantial benefit.
CHAPTER 43. IPV6 ADDRESSING 298
This is actually a pretty interesting question. You may be using IPv6 with-
out even knowing it. Before we go any farther, here are a few things you
can try so you will know where you stand right now.
First, visit http://test-ipv6.com/ to see whether your device can com-
municate using IPv6 at this moment. For me, the first time I tried it the
answer was no, but after making a few small adjustments (mentioned below)
the answer turned into yes.
Next, to see what is going on in your browser, install an IPv6 add-on.
For example, install IPvFox for Firefox or IPvFoo for Chrome. (I installed
IPvFoo for Chrome.) This will show you whether the webpage you are
viewing arrived on the IPv6 channel or on the IPv4 channel. It will also
show you where the sub-parts of that webpage came from.
Most people are just using IPv4 at this point (December 2016).
changes in any of the other protocol layers. We just swap one mechanism
(IPv4) for another (IPv6).
In order to use IPv4, both endpoints and all the routers in between must
support the IPv4 protocol. This is the norm.
Similarly, in order to use IPv6, both endpoints and all the routers in between
must support the IPv6 protocol. It is a complete replacement for IPv4.
IPv6 and IPv4 are not compatible with each other. They do not need to
be. They exist side by side. They are different languages. Specifically, an
IPv6-only device cannot talk to an IPv4-only device, nor vice versa. Instead,
IPv6 can only talk to IPv6 and IPv4 can only talk to IPv4.
Exam Question 482 (p.348): Are IPv6 and IPv4 compatible with each
other?
Required Answer: no
But we do have bi-lingual devices, devices that can speak in both languages.
We identify devices as being IPv4-only, IPv6-only, and dual-stack.
Exam Question 483 (p.348): What does native dual stack mean?
Acceptable Answer: both ipv4 and ipv6 are supported by the sender or
receiver
There are four devices (or groups of devices) on your path to communication:
Self. Gateway. Internet. Server.
Self: The first device is the one you are directly using. Your laptop. Your
cell phone. Buried in its operating system there are network drivers, also
known as the network stack. Your device can be IPv4-only, IPv6-only (the-
oretically), or dual stack. Modern devices are dual stack. Older devices may
be IPv4-only.
Gateway: The second device is your gateway router. Typically this is the
source of your IP address, which you learn through DHCP, the dynamic host
configuration protocol. Often these have an IPv6 setting that is available,
and often this setting is turned off. You may need to turn it on for IPv6 to
work for you.
Normally devices are assigned an IP address through the DHCP configura-
tion process. As each device begins to use the network, it requests informa-
CHAPTER 43. IPV6 ADDRESSING 300
tion about that network and its place in it. Normally this is provided by a
DHCP server.
Potential Bottleneck: I found that my router was limiting me to IPv4 until
I made a small change in its configuration. Then, suddenly, I was fully able
to use IPv6.
Internet: The next group of devices is the routers of the Internet, starting
with your ISP and ending with the ISP of your target (the server you are
trying to communicate with). Since June 6, 2012 the Internet Backbone
fully supports IPv6 so you should have no problems here.
There is actually an interesting trick at work here, too. Some parts of the
Internet already run IPv6-only. To allow IPv4 traffic to pass, they do a
thing called tunneling, where they temporarily encapsulate the IPv4 traffic
inside an IPv6 shell, send it across, and strip off that shell when it reaches
the other end of the backbone.
Server: The last device is the server you are trying to reach.
Many servers have been upgraded to be dual-stack. Such servers support
both IPv4 and IPv6 for their traffic. Here are some well-known examples (as
of December 2016): google, youtube, facebook, yahoo, wikipedia, linkedin,
and netflix.
But there are still many websites that do not support IPv6 yet (as of De-
cember 2016). Here are some well-known examples: amazon, reddit, twitter,
ebay.
Web hosting has still not caught IPv6 fever. When I checked (December
2016) several reviews of web hosting providers, nowhere was IPv6 even men-
tioned. One explanation is that IPv4 addresses are becoming scarce, so web
hosting providers can charge extra for them, whereas IPv6 addresses are
plentiful.
Potential Bottleneck: I run several websites and my web hosting provider
does not support IPv6. Someday probably, but not today.
Under IPv4 there are two main ways addresses get assigned: static and
dynamic.
Static (also called manual) means that someone enters the address into the
CHAPTER 43. IPV6 ADDRESSING 301
device and the device remembers it. When it boots up and connects to the
network, it already knows its address. It just starts using it.
Dynamic (also called stateful) is usually done through DHCP. The DHCP
server presents an address for the host to use.
Under IPv6 we can also have static and dynamic addresses. And there is
one more that is popular: SLAAC (also called stateless).
Exam Question 484 (p.348): What does SLAAC stand for?
Acceptable Answer: stateless address auto configuration
With SLAAC, the device uses the first 64 bits provided by the host network
and creates its own last 64 bits. It just needs to verify (using the DAD
protocol) that nobody is already using that address.
Exam Question 485 (p.348): What does DAD stand for?
Acceptable Answer: duplicate address detection
Marketers and law enforcement have been both excited and frustrated with
the advent of IPv6. Those who were excited believed that with all these
IPv6 addresses it would be easier to track potential customers or criminals.
That is because NAT made it difficult to track people under IPv4. But with
IPv6 there is no need for NAT.
It is true that IPv6 lets each device have its own IP address instead of
sharing one behind some form of NAT. But it is also true that IPv6 lets
each device have a new IP address every day (or as often as it wants).
So, if you are into marketing or law enforcement and if you want to track
who did what, and you are planning to use IPv6 addresses to tell you, you
will probably be disappointed. You should be looking at other things like
cookies and super cookies.
With many devices starting to use the Internet for communication, we have
a growing phenomenon that is popularly called the Internet of Things.
Exam Question 486 (p.348): What does IoT stand for?
CHAPTER 43. IPV6 ADDRESSING 302
The primary reason for creating IPv6 was the obvious future that showed
IPv4 would run out of addresses eventually. But once it was clear that IPv6
would be needed, it was important to fix as many problems as possible.
Addresses: IPv4 has an address space of about 4.3 billion (4.3×109 ) usable
addresses. This is because IPv4 addresses are 32 bits long. Each time you
add a bit, you double the number of possible addresses. 232 is about 4
billion.
To get more addresses, we have to have more bits. How many should we
have? After much deliberation, the committee decided to have 128 bits, four
times as many as IPv4. That makes 2128 possible addresses, which is about
64 billion billion billion billion.
Exam Question 487 (p.348): Which has a larger address space, IPv4 or
IPv6?
Acceptable Answer: IPv6
Exam Question 488 (p.348): In IPv4 how many bits does an address
have?
Required Answer: 32
Exam Question 489 (p.348): In IPv6 how many bits does an address
have?
Required Answer: 128
Nobody really likes to type out individual bits. Instead we write them in
groups. In IPv4 we do not write out 32 individual bits. Instead we write
out four groups of 8 bits. In IPv6 we do not write out 128 individual bits.
CHAPTER 43. IPV6 ADDRESSING 303
(b) if one or more entire groups are just zero, they can be replaced with
:: (the double colon).
For example, here is an IPv6 address:
0000:0000:0000:0000:0000:0000:0000:0001
We can remove leading zeros. That gives us this:
0:0:0:0:0:0:0:1
We can replace groups of zeros with ::, as follows:
::1
In fact, the zero (aka the “unspecified”) address can be simply written as:
::
Here is another example:
2001:db8:0:0:0:0:0:1234
It could be written like this:
2001:db8::1234
Incidentally, the ::1 address in IPv6 corresponds to 127.0.0.1, the localhost
address, in IPv4. The localhost address is also called the loopback address.
Exam Question 498 (p.349): In IPv4 what is the localhost address?
Required Answer: 127.0.0.1
Exam Question 499 (p.349): In IPv6 what is the localhost address?
Required Answer: ::1
Exam Question 500 (p.349): In IPv6 what is the unspecified address?
Required Answer: ::
The unspecified address is the zero address.
Exam Question 501 (p.349): In IPv6 what is the link local network ad-
dress?
Required Answer: fe80::/64
fe80/64 is 1111 1110 1000 and the rest of the 64 bits are zero.
Link local is similar to self-assigned 169.254.x.x addressing in IPv4.
Exam Question 502 (p.349): In IPv6 what is the all-host multi-cast ad-
dress?
Required Answer: ff02::1
CHAPTER 43. IPV6 ADDRESSING 305
The all-host multi-cast address is the IPv6 equivalent of the local network
or subnet broadcast address.
43.11 Subnets
In IPv4, a Class A address has 8 bits for network, and CIDR or a netmask
is used to express how many of the remaining 24 bits are used for subnet.
Up to 22 can be used.
In IPv4, a Class B address has 16 bits for network, and CIDR or a netmask
is used to express how many of the remaining 16 bits are used for subnet.
Up to 14 can be used.
In IPv4, a Class C address has 24 bits for network, and CIDR or a netmask
is used to express how many of the remaining 8 bits are used for subnet. Up
to 6 can be used.
In IPv6, there are no classes. There are 48 bits used for network and 16 (or
more) bits are used for subnet. The remaining 64 bits (or less) are used to
identify the host. If more than 16 bits are needed for subnet, CIDR is used
to express how big the subnet is.
Exam Question 503 (p.349): In IPv6 how many bits are reserved for the
network?
Required Answer: 48
Exam Question 504 (p.349): In IPv6 how many bits are reserved for the
subnet?
Required Answer: 16
Exam Question 505 (p.349): In IPv6 how many bits are reserved for the
host?
Required Answer: 64
Unit XI
Cisco IOS
306
Chapter 44
Cisco IOS
Contents
44.1 Internetworking . . . . . . . . . . . . . . . . . . . 307
44.2 IOS and SDM . . . . . . . . . . . . . . . . . . . . 309
44.3 Managing Cisco . . . . . . . . . . . . . . . . . . . 310
44.4 IP Routing . . . . . . . . . . . . . . . . . . . . . . 312
44.1 Internetworking
307
CHAPTER 44. CISCO IOS 308
Exam Question 514 (p.350): Give the Cisco IOS command to enter priv-
ileged mode.
Required Answer: enable
Exam Question 515 (p.350): Give the Cisco IOS command to leave priv-
ileged mode.
Required Answer: disable
Exam Question 516 (p.350): Give the Cisco IOS command to leave user
mode.
Required Answer: logout
Exam Question 517 (p.350): Give the Cisco IOS command to enter con-
figuration mode.
Required Answer: conf t
conf t is short for configure terminal.
Exam Question 518 (p.350): What does the Cisco IOS ’co?’ command
CHAPTER 44. CISCO IOS 310
do?
Acceptable Answer: list all commands that start with ’co’
Exam Question 519 (p.350): What does the Cisco IOS ’show history’
command do?
Acceptable Answer: It displays all recently entered commands.
Exam Question 520 (p.350): What does the Cisco IOS ’show version’
command do?
Acceptable Answer: It displays basic information about your hardware
and operating system.
You need to understand the four main places where things are stored: RAM,
ROM, NVRAM, and Flash. You need to know basically what is stored in
each place.
Nothing is “stored” in RAM, but when the router is operational, the running
configuration is in RAM.
ROM cannot be changed, so it holds only the most basic things, things that
would never change, such as the power-on self-test, the ROM monitor, and
the mini-IOS.
Flash is removable. It holds the IOS.
NVRAM is like Flash, but is not removable. It holds the startup configura-
tion, which includes the enable secret (password).
The configuration register is very small. I suspect it is stored in NVRAM
along with the startup configuration, but I am not sure.
Exam Question 521 (p.350): What does RAM stand for?
Required Answer: random access memory
Exam Question 522 (p.350): What does ROM stand for?
Required Answer: read-only memory
Exam Question 523 (p.350): What does NVRAM stand for?
Acceptable Answer: non-volatile random-access memory
Exam Question 524 (p.350): What does POST stand for?
CHAPTER 44. CISCO IOS 311
configuration.
Exam Question 536 (p.350): Where is the ’enable secret’ password stored?
(ram, rom, flash, nvram)
Required Answer: nvram
Exam Question 537 (p.351): Why is BREAK important?
Acceptable Answer: It lets you interrupt the boot process, enter the
ROM monitor, and change the configuration register even without the
enable secret password.
Exam Question 538 (p.351): Explain 0x2102.
Acceptable Answer: It is the normal configuration register setting.
Exam Question 539 (p.351): Explain 0x2142.
Acceptable Answer: It is the configuration register setting to avoid load-
ing the startup configuration, which allows password recovery.
44.4 IP Routing
In this chapter, we learn about static routing and RIP-based dynamic rout-
ing. We also learn the IOS commands to configure them.
Exam Question 540 (p.351): What does ’sh ip route’ do?
Acceptable Answer: show the IP routing table
By seeing the routing tables, we can verify that things are set up properly.
Exam Question 541 (p.351): What does the frame destination address
point to?
Acceptable Answer: next receiver in same lan
The frame destination address is a layer 2 physical (MAC) address.
For a packet that has a destination beyond the current LAN, the frame
destination address will be the address of the next router in its path.
Exam Question 542 (p.351): What does the packet destination address
point to?
Acceptable Answer: final destination ip address
The packet destination addrtess is a layer 3 logical (IP) address.
Exam Question 543 (p.351): What does an ’arp’ request return?
CHAPTER 44. CISCO IOS 313
Other Things
314
Chapter 45
Contents
45.1 Some Assumptions . . . . . . . . . . . . . . . . . . 315
45.2 Do Some Research . . . . . . . . . . . . . . . . . . 316
45.3 Connect To The Router . . . . . . . . . . . . . . 316
45.4 Find Your IP Address . . . . . . . . . . . . . . . 316
45.5 Browse To Your Gateway . . . . . . . . . . . . . 317
45.6 After You Log In . . . . . . . . . . . . . . . . . . . 317
45.7 Try A Wireless Connection . . . . . . . . . . . . 318
Here is a scenario. Let’s say your friend is trying to set up his new wireless
router. He knows you took a class in networking, so he is asking for help.
You want to help him. What do you do?
Here are some steps you can follow to be of assistance.
315
CHAPTER 45. HELPING YOUR FRIEND SET UP A ROUTER 316
Let’s assume that you have a Cat5 cable you can use to connect directly to
the router.
Get a copy of the manual for that router. If you have the paper copy that
came with the router, that is fine. Otherwise, maybe there is a CD-ROM
that came with the router, and it may have a PDF of the manual on it.
That is fine too. If all else fails, use a search engine like Google to find the
manual and download a copy of it to your laptop.
We can assume that your friend has not changed the username or password
for his router, but if he has, find out what they are.
You will want to find the default username and password for the router.
If all else fails, use a search engine (like Google) and search for “default
username” and mention his router. You should be able to find the username
and password.
The best way to do this is by using a Cat5 cable. Turn off your laptop’s
Wi-Fi and go directly through the cable.
If you go through Wi-Fi instead, there is a risk that you will not be con-
necting to your friend’s router. Maybe you will connect with someone else’s
router. Better to be safe.
The router probably has DHCP running, and will issue an IP address to your
laptop. Use ipconfig or something like it to discover your own IP address,
as assigned by the router.
It will probably be something like 192.168.1.100.
You also want to find the IP address of your gateway. It is probably the
same thing as your own IP address, but the last quad will be 1. (It could
be something else, but 1 is the most common.)
CHAPTER 45. HELPING YOUR FRIEND SET UP A ROUTER 317
Admin Password: Work with your friend to select a new password. Pick
something good. Write it down. In fact, it’s okay to write it on a sticky note
and tape it to the side or bottom of the router. After all, anyone that has
physical access to the router can reset it anyway, so writing the password
down is not a big deal.
Wi-Fi SSID: Work with your friend to select a Service Set Identifier to
be the name of his Wi-Fi access point. Personalize it. Don’t leave it as
“linksys” or something else generic.
Wi-Fi Password: Work with your friend to select a password that others
can use when they connect to his Wi-Fi access point. THIS SHOULD
NOT BE THE SAME AS THE ADMIN PASSWORD. You should
probably make it something easy to remember so he can tell his other friends
when they visit.
Go through the other settings and adjust anything that seems important to
you.
Make sure you save your changes. Typically this will cause the router to
reboot itself, or ask you for the new password.
If you decided to change the network numbers, you may need to reconnect
using a new IP address.
CHAPTER 45. HELPING YOUR FRIEND SET UP A ROUTER 318
Appendix
319
Appendix A
Test Bank
Test Bank
3: (p.10) What’s the difference between the Web and the Internet?
320
TEST BANK 321
37: (p.26) Is there any special meaning to the order of the parts in a domain
name? If so, what?
48: (p.34) How does a typical laptop computer discover its own IP address?
49: (p.34) How does a typical server computer discover its own IP address?
51: (p.38) What layer number is the Application layer of the OSI model?
53: (p.38) What layer number is the Presentation layer of the OSI model?
57: (p.39) What layer number is the Session layer of the OSI model?
59: (p.39) What layer number is the Transport layer of the OSI model?
61: (p.40) What is the typical value for MTU (in bytes)?
66: (p.41) Which protocol provides for fast (but not guaranteed) delivery of
information?
72: (p.41) What layer number is the Network layer of the OSI model?
86: (p.43) What layer number is the Data Link layer of the OSI model?
88: (p.43) How does a typical laptop computer discover its own MAC ad-
dress?
101: (p.44) What layer number is the Physical layer of the OSI model?
124: (p.63) List in any order the five non-routable IP address blocks
129: (p.66) In NAT, how does the router remember the original sender?
136: (p.76) What is a typical broadband upload speed in megabits per second
(2013, Worldwide)?
139: (p.76) List in either order the two measures of network speed.
140: (p.76) List in any order the three measures of network speed.
149: (p.80) What is the technical term for a connection that can use either
straight-through or crossover cables?
155: (p.81) What two times should you connect your computer directly to a
modem?
TEST BANK 329
156: (p.83) List in any order the five services a typical home router provides.
166: (p.84) How fast is 802.11n Wi-Fi in Mb/s (theoretical max per channel)?
167: (p.85) How many connections can a Wi-Fi access point handle?
178: (p.93) List in either order the two router configuration default values
you should not keep.
179: (p.93) List in any order the two passwords a home router normally has.
180: (p.99) What is the maximum length (in meters) for Cat5 cabling?
181: (p.100) With T568 wiring, are the striped wires odd or even?
182: (p.100) With T568 wiring, are the solid-color wires odd or even?
183: (p.100) With T568A wiring, what color goes in slots 1 and 2?
184: (p.101) With T568B wiring, what color goes in slots 1 and 2?
185: (p.101) With T568A wiring, what color goes in slots 3 and 6?
186: (p.101) With T568B wiring, what color goes in slots 3 and 6?
187: (p.101) With T568A wiring, what color goes in slots 4 and 5?
188: (p.101) With T568B wiring, what color goes in slots 4 and 5?
189: (p.101) With T568A wiring, what color goes in slots 7 and 8?
190: (p.101) With T568B wiring, what color goes in slots 7 and 8?
193: (p.109) With Global Broadcast Ping, who is the first responder?
194: (p.109) With Global Broadcast Ping, who is the second responder?
197: (p.118) What are the two main Wi-Fi frequency ranges?
198: (p.119) What 802.11b Wi-Fi channels exist (in the USA)?
200: (p.119) Which Wi-Fi band gets better distance, 2.4 or 5.0?
201: (p.120) Which Wi-Fi band has less competition, 2.4 or 5.0?
202: (p.120) Which Wi-Fi band has more usable channels, 2.4 or 5.0?
205: (p.121) What 802.11b channels are commonly usable (in the USA)?
212: (p.123) List in any order the three Wi-Fi security methods that are
commonly used.
216: (p.125) What is the legal maximum Wi-Fi signal (in milliwatts) in the
USA?
221: (p.128) What is the minimum SNR (in dB) needed for a usable connec-
tion?
222: (p.129) What is the typical range (in meters) for Wi-Fi signals?
TEST BANK 333
223: (p.129) For typical Wi-Fi, how much signal (in dB) can be used up
before the SNR is too low for useful communication?
224: (p.129) For typical Wi-Fi, how much signal (in dB) is lost per ten meters
of open air?
225: (p.130) For typical Wi-Fi, how much signal (in dB) is lost per interior
wall (plaster-board, wooden studs)?
226: (p.130) For typical Wi-Fi, how much signal (in dB) is lost per exterior
wall (wood, brick, cement block, metal studs)?
227: (p.130) For typical Wi-Fi, how much signal (in dB) is lost per floor
(thick plywood, support beams)?
228: (p.131) Name at least three typical indoor obstacles that affect Wi-Fi
signal strength.
229: (p.131) Name at least three typical outdoor obstacles that affect Wi-Fi
signal.
Unit V: Security
232: (p.136) List in any order the four measures of password quality.
241: (p.141) If several high-value passwords are the same is that okay?
242: (p.141) If several low-value passwords are the same is that okay?
246: (p.146) List in any order the four types of things used to prove identity
(four single words).
266: (p.155) Whose key, and which key do you use to send a private message
to Bob?
269: (p.156) Whose key, and which key do you use to sign a message?
271: (p.157) How can Bob send a private, authenticated message to Alice?
276: (p.160) What does the RSA private key consist of?
277: (p.160) What does the RSA public key consist of?
281: (p.163) For what three things are botnets commonly used?
287: (p.166) How can firewalls defend against network attacks on clients?
288: (p.166) How can firewalls defend against network attacks on servers?
289: (p.167) How does DDOS defeat firewall protection for servers?
295: (p.174) When an IPv4 address is written in x.x.x.x format, the possible
value for x range from 0 to what?
317: (p.188) What is the IPv4 special address range for the local network?
319: (p.188) In the Class A Private Address Range, how many (classful)
networks are there?
320: (p.188) In the Class A Private Address Range, what is the first IP
address?
321: (p.188) In the Class A Private Address Range, what is the first usable
host address?
322: (p.188) In the Class A Private Address Range, what is the last IP ad-
dress?
323: (p.188) In the Class A Private Address Range, what is the last usable
host address?
325: (p.188) What is the Link Local (APIPA) Private Address Range?
328: (p.189) In the Class B Private Address Range, how many (classful)
networks are there?
329: (p.189) In the Class B Private Address Range, what is the first IP
TEST BANK 339
address?
330: (p.189) In the Class B Private Address Range, what is the first usable
host address?
331: (p.189) In the Class B Private Address Range, what is the last IP ad-
dress?
332: (p.189) In the Class B Private Address Range, what is the last usable
host address?
334: (p.189) In the Class C Private Address Range, how many (classful)
networks are there?
335: (p.189) In the Class C Private Address Range, what is the first IP
address?
336: (p.190) In the Class C Private Address Range, what is the first usable
host address?
337: (p.190) In the Class C Private Address Range, what is the last IP ad-
dress?
338: (p.190) In the Class C Private Address Range, what is the last usable
host address?
344: (p.192) For 199.199.199.199, what is the default Net Mask in CIDR and
TEST BANK 340
383: (p.223) Using ping to troubleshoot, conventional wisdom says you should
ping what first?
384: (p.223) Using ping to troubleshoot, conventional wisdom says you should
ping what second?
385: (p.223) Using ping to troubleshoot, conventional wisdom says you should
ping what third?
386: (p.223) Using ping to troubleshoot, conventional wisdom says you should
ping what fourth?
390: (p.226) How can you (the user) find your IP address?
391: (p.227) What things does a successful ping to your own LAN address
prove?
392: (p.228) What things does a successful ping to your neighbor prove?
394: (p.229) What is a broadcast ping with a fake source address called?
397: (p.231) What things does a successful ping to something beyond your
LAN prove?
TEST BANK 343
413: (p.238) In a program name, what does the suffix d usually mean?
421: (p.247) List in any order the three main network topologies in use today.
427: (p.250) List in any order two protocols that use broadcast in a LAN.
435: (p.254) About how many seconds does it take STP to converge?
438: (p.255) List in any order classic STP’s four port state options.
440: (p.256) About how many seconds does it take RSTP to converge?
444: (p.260) List the two main things that traceroute reports.
453: (p.265) List in any order the three layers of the Cisco router model.
455: (p.267) How can we tell if two machines are in the same LAN?
456: (p.267) When does a computer send a frame directly to its destination?
457: (p.267) When does a computer send a frame directly to the gateway?
459: (p.267) If the router’s IP address is 1.2.3.4, what is the most likely value
for the gateway address in that LAN?
462: (p.269) How does NAT defend against attacks on local computers?
463: (p.271) What happens when both LANs for the router have the same
network number?
TEST BANK 347
Unit X: IPv6
482: (p.299) Are IPv6 and IPv4 compatible with each other?
490: (p.303) In IPv4 how many groups of bits does an address have?
492: (p.303) In IPv6 how many groups of bits does an address have?
494: (p.303) In IPv4 each group of bits is written in what number base?
TEST BANK 349
495: (p.303) In IPv6 each group of bits is written in what number base?
503: (p.305) In IPv6 how many bits are reserved for the network?
504: (p.305) In IPv6 how many bits are reserved for the subnet?
505: (p.305) In IPv6 how many bits are reserved for the host?
514: (p.309) Give the Cisco IOS command to enter privileged mode.
515: (p.309) Give the Cisco IOS command to leave privileged mode.
516: (p.309) Give the Cisco IOS command to leave user mode.
517: (p.309) Give the Cisco IOS command to enter configuration mode.
518: (p.309) What does the Cisco IOS ’co?’ command do?
519: (p.310) What does the Cisco IOS ’show history’ command do?
520: (p.310) What does the Cisco IOS ’show version’ command do?
525: (p.311) Where is the POST stored? (ram, rom, flash, nvram)
527: (p.311) Where is the ROM monitor stored? (ram, rom, flash, nvram)
528: (p.311) Where is the mini-IOS stored? (ram, rom, flash, nvram)
529: (p.311) Where is the IOS stored? (ram, rom, flash, nvram)
536: (p.312) Where is the ’enable secret’ password stored? (ram, rom, flash,
TEST BANK 351
nvram)
541: (p.312) What does the frame destination address point to?
542: (p.312) What does the packet destination address point to?
549: (p.313) What does ’ip route 1.1.1.0 255.255.255.0 5.6.7.8’ mean?
550: (p.313) What does ’ip route 0.0.0.0 0.0.0.0 5.6.7.8’ mean?
353
INDEX 354