search the web

Monday, October 31, 2016

Router and Routing Algorithm

Router

-A router acts as a junction between two or more
networks

-Routers use IP addresses to identify packet
recipients (commonly a layer 3 item)

-Routers communicate with other routers to
build/identify complex data paths

(=> routing)

router CCNA tutorials
Router

layers in Router
layers in Router
layers in Router

Routing

-A router acts as a junction between two or more networks
-Routers use IP addresses to identify packet
recipients (commonly a layer 3 item)
-Routers communicate with other routers to
build/identify complex data paths

routing Overview

Types of routing
- static routing
- dynamic routing

Dynamic mechanisms
- distance vector
- link-state algorithm

Routing basics


-Routing takes place on IP level
network layer (3)

-Routing is needed

- when the packages‘ destination is beyond the own network
- to manage traffic between different networks

-Routes are determined by routers
- Therefore routers uses so called routing-tables

Basic Routing algorithms using by Router
Basic Routing algorithms using by Router

Static routing


— Predefined static route between two hosts in
different networks

— Static routes are defined in so called static
routing tables

— Advantages:
- Routes are transparent and comprehensible

- Routes are trusted .
(at least the direct neighbors & default gateway)

- Simple tracing of errors (who to blame)

— Disadvantages:
- High administration effort and very large routing tables

static routing tables

static routing tables
static routing tables

Static Routing in LAN

— In local area networks (LANs)
static routes_are used to
connectthe Internal hosts
to superior networks

 

— Therefore each hosts has an
entry_ In Its routing table, to
specn‘y the router, that has
to be used as default gateway

(at the border of the LAN)

Dynamic routing

— Router is able to select packages' routes dynamically

— This selection is determined by different routing
protocols / Implementations

— Advantages:
- Less care necessarily
- Short reaction time on failures or resources bottlenecks

— Disadvantages:
- Exchange of control information necessarily
- Error tracing is more difficult
- Installation required



— Used where static routing is nearly impossible
- the number of networks / subnets is to large
- high dynamic network structures / metrics

— Used to interconnect a huge number of larger networks

Dynamic Routing
Dynamic Routing
(so called autonomous systems)
- distributed enterprise networks
- distributed educational networks

-> the ”parts”, which build the internet


— Autonomous System (AS)

is an IP network that is administrated
as one single entity

e.g. universities, lSPs, international
companies

— The connection between all public
ASs is called the internet

— AS's external routers use
Exterior Gateway Protocols (EGP)
to exchange the routing information

Autonomous Systems
Autonomous Systems

— The worldwide standard EGP is the Border Gateway Protocol


— Autonomous Systems (AS)
are IP networks that are
administrated as one
single entity

— Within an AS the router uses
Interior Gateway Protocols

— IGPs route between the subnets
of an AS

— At the ed e of the AS the routers
speak EG and IGP

— Both, EGP and IGP are dynamic routing
protocols


The two kinds of dynamic protocols


Main principles of the two kind of dynamic protocols:

- Distance vector protocols:

tell your neighbours, how the world looks for you

e.g. RIP (routing information protocol)
- Link-state protocols:

tell the world, who your neighbours are

e.g. OSPF (open shortest path first)
based on Dijkstra‘s algorithm

- Overview: RIP


— Routing Information Protocol

— Defined in RFC 1058

— Uses UDP protocol to exchange routing information
- via port 520

— Distributed computing of the routes

— Maximum of 15 hops

— No authentication of routers (less secure)

— Distributed computing of the routes

After initialization each router possesses a matrix
that stores the distances to all possible destination
networks (called routing table)

The used metric here is the hop count and gets increased
for each router, the package has to passes hrough

Hop count 16 means destination network is unreachable
Update time is every 30 sec

— if router is not responding for 180 sec, it gets tagged as
unreachable
Overview: RIP
Overview: RIP

Overview: OSPF


— Open Shortest Path First
— Defined in the RFC 2328
— Uses IP protocol 89

— Decentralized computing of the shortest way
between two routers

(Dijkstra algorithm - shortest path first)

— no hop-count-Iimit

(—> suitable for large networks)

— Authentication via MD-5 checksum

7 After initia/izat/on each router possesses a map of
the whole network topology

* Used metric is mostly the accumulated bandwidth

7 Using “hello protocol” to ensure, that the neighbours
are still available (hello package every 10 - 30 sec)

7 Actualization of the network information via the flooding
protocol (broadcasting to whole network)

r If there is no respond for a certain number of hello
packages all routers get informed / updated by using
flooding packages
OSPF - Algorithms
OSPF - Algorithms

Sequence in principles of OSPF - Algorithms

Sequence in principles of OSPF - Algorithms
Sequence in principles of OSPF - Algorithms


Monday, October 17, 2016

IP Subnetting

Subnetting

With the rapid growth of the Internet & the ever-increasing
demand for new addresses, the standard address class structure
has been expanded by borrowing bits from the Host portion to
allow for more Networks.

Subnetting reduces the size of the routing tables stored
in routers.
Subnetting extends the existing IP address base &
restructures the IP address.
As a result, routers must have a way to extract from a IP
address both the Network address & the Host address.

Subnetting Networks ID

A 3-step example of how the default Class A subnet
mask is applied to a Class A address:
subnetting networks ID
subnetting networks ID

Subnetting, Subnet & Subnet Mask



-Subnetting, a subnet & a subnet mask are all
different.
-In fact, the 1 st creates the 2 nd & is identified by the 3 rd .
-Subnetting is the process of dividing a network & its
IP addresses into segments, each of which is called a
subnetwork or subnet.

Subnetting

-A network has its own unique address, such as a
Class B network with the address 172.20.0.0 which
has all zeroes in the host portion of the address.

-From the basic definitions of a Class B network &
the default Class B subnet mask, you know that this
network can be created as a single network that
contains 65,534 individual hosts.

Benefits of Subnetting

-Fewer IP addresses are needed to provide
addressing to a network & subnetting.

-Subnetting usually results in smaller routing tables
in routers

Example of Subnetting

-when the network administrator divides the
172.20.0.0 network into 5 smaller networks: –
172.20.1.0, 172.20.2.0, 172.20.3.0, 172.20.4.0 &
172.20.5.0 –

-the outside world still knows the network as
172.20.0.0, but the internal routers now break the
network addressing into the 5 smaller subnetworks.

Subnetting Example
Subnetting Example 

Subnetmask Function

-The function of a subnet mask is to determine whether an IP address
exists on the local network or whether it must be routed outside the
local network.

-It is applied to a message’s destination address to extract the network
address.

-If the extracted network address matches the local network ID, the
destination is located on the local network.

-However, if they don’t match, the message must be routed outside the
local network.


Subnetting Concept

-The key concept in subnetting is borrowing bits from
the host portion of the network to create a subnetwork.

-Rules govern this borrowing, ensuring that some bits
are left for a Host ID.

-The rules require that two bits remain available to use
for the Host ID & that all of the subnet bits cannot be
all 1s or 0s at the same time ( -2 ).

Fixed Subnet (Classful)

Fixed Subnet (Classful)
Fixed Subnet (Classful)

CIDR: Classless InterDomain Routing

- Subnet portion of address of arbitrary length
- Address format: a.b.c.d/x, where x is # bits in subnet portion
of address subnet part host part:

Example:
11001000 00010111 00010000 00000000
200.23.16.0/23

Knowing How to Calculate Subnets

To determine the number of subnets & hosts per
subnet available for any of the available subnet
masks, 2 simple formulas to calculate these numbers:
Knowing How to Calculate Subnets
Knowing How to Calculate Subnets

Class A Subnetting Options
Class A Subnetting Options
Class A Subnetting Options

Class B Subnetting Options

Class B Subnetting Options
Class B Subnetting Options


Class C Subnetting Options

SubnetMask                      SubnetMask                   # Hosts
255.255.255.0/24                                                    256 (254)
255.255.255.128 /25                                              128 (126)
255.255.255.192 /26                                                  64 (62)
255.255.255.224 /27                                                  32 (30)
255.255.255.240 /28                                                  16 (14)
255.255.255.248 /29                                                      8 (6)
255.255.255.252 /30                                                      4 (2)

Subnetting

Example:
In network 192.168.10.0
255.255.255.0
We have here ONE Class C network, with 253 usable IPs
for Client-PCs.

The usable IP range of this network is
192.168.10.1 - 192.168.10.254

The very last IP of each Subnet is called:
Broadcast-Address

In this example 192.168.10.255 and it is NOT! usable for host
PCs
If we want to divide this network in two parts,we must use
subnetting

With subnetmask 255.255.255.128 we divide the network in two
Parts :

    192.168.10.1 – 192.168.10.127
    192.168.10.128 – 192.168.10.255

So in this example BEFORE, we had one big network but
With the change of the subnetmask we divided it in two smaller
networks

First with Subnetmask 255.255.255.0 we had this network:
192.168.10.0
The range:
192.168.10.1, 192.168.10.2
...
192.168.10.253, 192.168.10.254, 192.168.10.255

Now with Subnetmask 255.255.255.128 we have these two networks:
1st Subnet:
{ 192.168.10.0 (!NOT usable for Host PCs)
192.168.10.1, 192.168.10.2,192.168.10.3,
...
192.168.10.125, 192.168.10.126, 192.168.10.127 }

2nd Subnet:
192.168.10.128
192.168.10.129, 192.168.10.130,192.168.10.131,
...
192.168.10.253, 192.168.10.254,192.168.10.255 (is NOT! usable for Host PCs)

Used Bits for Network

Examples:

/16 = 255.255.0.0 =
11111111.11111111.00000000.00000000

/20 = 255.255.240.0 =
11111111.11111111.11110000.00000000


Calculation of a subnetmask for a specified number of hosts

Example:

You get the following order:
"Create a subnet with minimum 10 host Ips".
1st : 
Calculate a power of two, that is minimum 10:
2^3 = 8 Is it enough?
2^4 = 16
It is higher than 10 AND WORKS!

2nd :

Now put the LAST 4 Bits of your subnetmask to 0:

11111111.11111111.11111111.11110000
That is in decimal 255.255.255.240
With this subnetmask, you have at least 10 Host IPs in the
subnet, without wasting to much IP Addresses !

Assignment

A: You get this order as system administrator:

A. The company has a network with 150 computers. Create a Subnet from
“ 172.31.0.0 ” so that it is smallest possible subnet to provide
enough IPs.
B. Convert the second IP of your solution to Hexadecimal.

Calculating the the Broadcast IP of a Subnet

Example:

There is a subnet 172.16.64.0/20
Question:
What is the BROADCAST of that subnet?

1st , /20 means 255.255.240.0

2nd , Analyze the subnet octet to find out the "network-jump"
240 means in binary 11110000
The last of the 1's is equal to decimal 16
That is our "network-jump"
(128/64/32/16/8/4/2/1)

The last network started at 172.16.64.0
16 is the "network-jump". That means our next
network starts from 172.16.80.0 – 172.16.95.255
and the next one?

+16    172.16.96.0 - 172.16.111.255
+16    172.16.112.0 – 172.16.127.255
...
Because the next subnet in the example starts from
172.16.80.0, the broadcast must be 172.16.79.255
Because that IP before the next subnet starts is the
Broadcast Address !

Sunday, October 2, 2016

OSI and TCP/IP Models

OSI and TCP/IP Models

The OSI Reference Model

- Planned to be a protocol stack for use
- Reference & communication model
- Used for troubleshooting
- It divides a complex process into small and
realizable units
The OSI Reference Model
The OSI Reference Model

Data Encapsulation:

The basic action of OSI
– Each layer responds services from superior layer
and issue services to the subordinate
– data moves into this seven layers to get the control
information

- Control informations are added in header & footer
- Headers and footer are fields that contain control
information
- Like post message
Each layer has its own PDU (Protocol Data Unit) which
contains different information

The PDU contains of a header and data field

Horizontal Connection

Horizontal Connection
Horizontal Connection

Encapsulation Words

Packet
– Naming data unit in each step
- The data traveling through the media

Frame
- In data link layer

Datagram
– In network layer

Segment
– In transport layer
– Sequence
- Collection of segments

Message
– In Application layer

Encapsulation

Encapsulation
Encapsulation

The difference between OSI and TCP/IP Models

OSI and TCP/IP Models
OSI and TCP/IP Models

TCP Packet Structure

TCP Source Port - Port of sending host
Destination Port – Port of End Point Destination
Sequence # – Sequence of Bytes transmitted
in a segment, required to verify that all bytes are
received
Acknowledgment Number – The sequence number
of the byte the local host expects to receive next
Data Length – Length of the TCP Segment
Flags – Specified what content is in the segment
Window – How much space is currently available in
the TCP window
Checksum – Verify that the Header is not corrupted

TCP Port

A TCP port provides a specific location for delivery of
TCP Segments. Port Numbers below 1024 are well-
known, and are assigned by:
Internet Assigned Numbers Authority (IANA)
TCP Port
TCP Port
In Ubuntu to see list of ports: less /etc/services

Well-Known ports
– For network applications
– Range
1-1023

Registered ports
– Range
1024 – 49151
– Can be either source or destination
– Used by organizations to register specific applications
such as IM application

Private ports
– Range
49152 through 65535
– Used as source ports, these ports can be used by any applications