In this webinar, we will discuss about the basic concept of routing, try to understand how the router work, how the routing table is used to forward packets, and how to implement them with mikrotik router. we review some prior knowledge before. after attending this webinar, we expect you understand how the packet is forwarded on router.
3. www.glcnetworks.com
What is GLC?
● Garda Lintas Cakrawala (www.glcnetworks.com)
● An Indonesian company
● Located in Bandung
● Areas: Training, IT Consulting
● Mikrotik Certified Training Partner
● Mikrotik Certified Consultant
● Mikrotik distributor
3
4. www.glcnetworks.com
About GLC webinar?
● First webinar: january 1, 2010 (title:
tahun baru bersama solaris - new
year with solaris OS)
● As a sharing event with various
topics: linux, networking, wireless,
database, programming, etc
● Regular schedule: every 2 weeks
● Irregular schedule: as needed
● Checking schedule:
http://www.glcnetworks.com/main/sc
hedule
● You are invited to be a presenter
○ No need to be an expert
○ This is a forum for sharing: knowledge,
experiences, information
4
5. www.glcnetworks.com
Trainer Introduction
● Name: Achmad Mardiansyah
● Base: bandung, Indonesia
● Linux user since ’99
● Mikrotik user since 2007
● Certified Trainer (MTCNA/RE/WE/UME/INE/TCE)
● Mikrotik Certified Consultant
● Work: Telco engineer, Sysadmin, PHP programmer,
and Lecturer
● Personal website: http://achmad.glcnetworks.com
● More info:
http://au.linkedin.com/in/achmadmardiansyah
5
8. www.glcnetworks.com
What are mikrotik products?
● Router OS
○ The OS. Specialized for networking
○ Website: www.mikrotik.com/download
● RouterBoard
○ The hardware
○ RouterOS installed
○ Website: www.routerboard.com
8
9. www.glcnetworks.com
What Router OS can do?
● Go to www.mikrotik.com
○ Download: what_is_routeros.pdf
○ Download: product catalog
○ Download: newsletter
9
12. www.glcnetworks.com
Layer 3
● Logical address
● 2 versions: IPv4 (our focus) and IPv6
● IPv4 32 bit long
● Consist of network part & host part
● Can be class based IP address (without subnet)
● Now it is classless IP address -> VLSM (variable
length subnet mask)
● CIDR (classless inter domain routing)
12
13. www.glcnetworks.com
IP spec (RFC 791)
● Defined long time ago (what 1981?)
● Defines how the IP header looks like
● Still used up to know
● New version -> IPv6
13
14. www.glcnetworks.com
How the layer 3 address look like?
● IPv4 address is 32 bit
● Written in binary
● Displayed to human in decimal every 8 bit (octet).
● Has 2 parts: network part and host part
● Like a phone number 0812 XXXXXXXX -> hierarchical
● All devices in the network will have same network address
● First and last address cannot be used (for network id and broadcast id)
14
Network part host part
15. www.glcnetworks.com
Layer 3 connection and addressing
● Devices that uses layer 3 information: router and host
● All devices must have a layer 3 address
● address is hierarchical
○ Network part (e.g. 192.168.0.2/26 -> the first 26 bit of all host in the network will be
the same) -> show the grouping identity
○ Host part
15
192.168.0.0/26
R1
192.168.0.1/26
192.168.0.3/26
192.168.0.2/26
R3
R2
192.168.1.0/24
192.168.2.0/24
192.168.3.0/24
192.168.3.3/24
192.168.3.9/24
192.168.2.9/24
192.168.2.2/24
192.168.1.1/24
192.168.1.9/24
16. www.glcnetworks.com
What is VLSM?
● Variable-Length Subnet Masking (VLSM)
● Can divide an IP address block into subnets of different sizes using / (slash)
notation
● Solution the in efficient of classful IP address (fixed length). No more class A,
class B, Class C -> pleeease dont say this classes anymore
● making it possible to create subnets with very different host counts without
wasting large numbers of addresses.
● RFC: 1878 (1995)
● Basis for CIDR
● Example: 23.45.0.0/16
○ 23.45.0.0/25
○ 23.45.0.128/25
16
18. www.glcnetworks.com
What is CIDR?
● CIDR: Classless Inter-Domain Routing (sometimes is called supernetting)
● CIDR solves problem of wasted address space by providing a new and more
flexible way to specify network addresses in routers (using slash as notation)
● allow flexible allocation of Internet Protocol (IP) addresses.
● Replaces classfull network (class A,B,C,D). Please dont ever mention this
anymore...
● CIDR lets a routing table entry represent an aggregation of networks that exist
in the forward path
● Each IP address has a network prefix that identifies either one or several
network gateways.
● RFC: 1519
18
21. www.glcnetworks.com
What is routing table?
● A table at router that is used to
forward packet
● Available on every devices (router
and host)
● Entry is executed sequentially
21
192.168.0.0/26
R1
192.168.0.1/26
192.168.0.3/26
192.168.0.2/26
R3
R2
192.168.1.0/24
192.168.2.0/24
192.168.3.0/24
192.168.3.3/24
192.168.3.9/24
192.168.2.9/24
192.168.2.2/24
192.168.1.1/24
192.168.1.9/24
destination gateway
192.168.0.0/26 direct
192.168.1.0/24 direct
192.168.2.0/24 192.168.0.2
192.168.3.0/24 192.168.0.3
192.168.16.3/32 192.168.0.2
0.0.0.0/0 192.168.0.3
22. www.glcnetworks.com
When router receive a packet…
(setup priority on routing table)
● Router will analyse the destination IP address
● Router will rearrange the routing entry and put priority
○ Longest prefix wins
○ Lowest distance wins
22
destination gateway
192.168.0.0/26 direct
192.168.1.0/24 direct
192.168.2.0/24 192.168.0.2
192.168.3.0/24 192.168.0.3
192.168.16.3/32 192.168.0.2
0.0.0.0/0 192.168.0.3
destination gateway
192.168.16.3/32 192.168.0.2
192.168.0.0/26 direct
192.168.1.0/24 direct
192.168.2.0/24 192.168.0.2
192.168.3.0/24 192.168.0.3
0.0.0.0/0 192.168.0.3
23. www.glcnetworks.com
How the routing table works (R1)?
● It works like a firewall: match and action
● You should think in binary to understand how it works
23
destination gateway
192.168.16.3/32
11000000 10101000 00001000 00000011
192.168.0.2
192.168.0.0/26
11000000 10101000 00000000 00
direct
192.168.1.0/24
11000000 10101000 00000001
direct
192.168.2.0/24
11000000 10101000 00000010
192.168.0.2
192.168.3.0/24
11000000 10101000 00000011
192.168.0.3
0.0.0.0/0 192.168.0.3
24. www.glcnetworks.com
A packet arrived… (part 1)
Destination IP address of the packet is 192.168.16.3, which gateway do we use?
A: 192.168.16.3 = (11000000 10101000 00001000 00000011)
24
destination gateway
192.168.16.3/32
11000000 10101000 00001000 00000011
192.168.0.2
192.168.0.0/26
11000000 10101000 00000000 00
direct
192.168.1.0/24
11000000 10101000 00000001
direct
192.168.2.0/24
11000000 10101000 00000010
192.168.0.2
192.168.3.0/24
11000000 10101000 00000011
192.168.0.3
0.0.0.0/0 192.168.0.3
MATCH
25. www.glcnetworks.com
A packet arrived… (part 2)
Destination IP address of the packet is 192.168.2.6, which gateway do we use?
A: 192.168.2.6 = (11000000 10101000 00000010 00000110)
25
destination gateway
192.168.16.3/32
11000000 10101000 00001000 00000011
192.168.0.2
192.168.0.0/26
11000000 10101000 00000000 00
direct
192.168.1.0/24
11000000 10101000 00000001
direct
192.168.2.0/24
11000000 10101000 00000010
192.168.0.2
192.168.3.0/24
11000000 10101000 00000011
192.168.0.3
0.0.0.0/0 192.168.0.3
NOT MATCH
NOT MATCH
NOT MATCH
MATCH
26. www.glcnetworks.com
A packet arrived… (part 3)
Destination IP address of the packet is 192.168.8.6, which gateway do we use?
A: 192.168.8.6 = (11000000 10101000 00001000 00000110)
26
destination gateway
192.168.16.3/32
11000000 10101000 00001000 00000011
192.168.0.2
192.168.0.0/26
11000000 10101000 00000000 00
direct
192.168.1.0/24
11000000 10101000 00000001
direct
192.168.2.0/24
11000000 10101000 00000010
192.168.0.2
192.168.3.0/24
11000000 10101000 00000011
192.168.0.3
0.0.0.0/0 192.168.0.3
NOT MATCH
NOT MATCH
NOT MATCH
MATCH
NOT MATCH
NOT MATCH
27. www.glcnetworks.com
Static routing
● Entries on routing table is created
manually
● Admin must manage routing table
in all routers
● Admin have full control
27
192.168.0.0/26
R1
192.168.0.1/26
192.168.0.3/26
192.168.0.2/26
R3
R2
192.168.1.0/24
192.168.2.0/24
192.168.3.0/24
192.168.3.3/24
192.168.3.9/24
192.168.2.9/24
192.168.2.2/24
192.168.1.1/24
192.168.1.9/24
destination gateway
192.168.0.0/26 direct
192.168.1.0/24 direct
192.168.2.0/24 192.168.0.2
192.168.3.0/24 192.168.0.3
192.168.16.3/32 192.168.0.2
0.0.0.0/0 192.168.0.3
28. www.glcnetworks.com
Dynamic routing
● Entries on routing table is created
automatically using routing protocol
(RIP, OSPF, BGP)
● Admin must have a good
knowledge about routing protocol
28
192.168.0.0/26
R1
192.168.0.1/26
192.168.0.3/26
192.168.0.2/26
R3
R2
192.168.1.0/24
192.168.2.0/24
192.168.3.0/24
192.168.3.3/24
192.168.3.9/24
192.168.2.9/24
192.168.2.2/24
192.168.1.1/24
192.168.1.9/24
destination gateway
192.168.0.0/26 direct
192.168.1.0/24 direct
192.168.2.0/24 192.168.0.2
192.168.3.0/24 192.168.0.3
192.168.16.3/32 192.168.0.2
0.0.0.0/0 192.168.0.3
33. www.glcnetworks.com
End of slides
● Thank you for your attention
● Please submit your feedback: http://bit.ly/glcfeedback
● Like our facebook page: “GLC networks”
● Stay tune with our schedule
33