Lab by hcj

VIEWS: 0 PAGES: 22

									IP Routing (CH9- 10)

 Dynamic routing: talk to adjacent routers, informing each other
                  what networks each router is currently connected.

 Routing daemon : the process that is running the routing protocol,
                  communicating with its neighbor routers.
        Daemon : process running in the background

 Routing table : routes are added, deleted dynamically
                 - by routing daemon
                 - by ‘route’ command
                 - when ICMP ‘redirect’ messages are received.
 Routing policy : daemon choose which route is best,
                   and which one to insert into the table.
  If the daemon finds multiple paths  choose the best one
  If the daemon finds a link has gone down  delete the affected routes,
                                                and add alternate routes.
                          Embedded Linux Experiment                     1
                              ANT lab. POSTECH
Interior (Exterior) Gateway Protocol


The internet is organized into a collection of autonomous systems.

Interior Gateway Protocol: Autonomous system 내에서의 routing protocol
                 - RIP : Routing Information Protocol (popular)
                 - OSPF : Open Shortest Path First Protocol (new)

Exterior Gateway Protocol: 서로 다른 autonomous system에 있는
                           router간의 protocol
                - BGP : Border Gateway Protocol




                           Embedded Linux Experiment                 2
                               ANT lab. POSTECH
    RIP Message Format


   Port No. 520




       request:1
       reply:2




Max. 24 routes

                   Embedded Linux Experiment   3
                       ANT lab. POSTECH
Operation of ‘routed’ Daemon
Using RIP
 Initialization: Request for other router’s routing table is broadcasted
                command : 1, address family : 0, metric : 16
 Request received: Entire routing table is sent to the requestor.
                     Set the metric to used value or 16.

 Respond received : - New entries can be added,
                    - Existing entries can be modified,
                    - Existing entries can be deleted.

 Regular routing updates: Every 30 seconds, routing table is broadcasted.
 Triggered updates: These occur whenever the metric for a route changes.

 •   3분동안 update가 되지않는 route가 발견되면 metric을 16으로 set하고
     1분을 더 기다린 다음 없애 버린다.


                              Embedded Linux Experiment                    4
                                  ANT lab. POSTECH
Metrics – Hop Counts

 R1 이 ‘N2가 hop count 1로 붙어 있다’고 N1에 braodcast 한다.
 R1 이 ‘N1가 hop count 1로 붙어 있다’고 N2에 braodcast 한다.
 R2 가 ‘N3가 hop count 1로 붙어 있다’고 N2에 braodcast 한다.
 R2 가 ‘N2가 hop count 1로 붙어 있다’고 N3에 braodcast 한다.




                     Embedded Linux Experiment      5
                         ANT lab. POSTECH
Example




          Embedded Linux Experiment   6
              ANT lab. POSTECH
Routing시 고려사항

 Robustness: 고장이나 트래픽 조건이 변경되었을 시
             배정결정을 적절히, 신속히, 용이하게 대응

 Stability   : 조건변화-> 경로변경 ->조건변화 의 싸이클이 안정되어야 한다.

 Fairness : 비슷한 전송속도, 비슷한 지연시간을 제공

 Optimality : minimize packet delay
              minimize the number of hops
              minimize the cost
              maximize throughput




                        Embedded Linux Experiment    7
                            ANT lab. POSTECH
Dijkstra Algorith
(Forward Serch)




                  Embedded Linux Experiment   8
                      ANT lab. POSTECH
Dijkstra Algorithm

M={s}
For each n not in M
   Dn= d(s,n)
While (M does not contain all nodes) do
    find w in N-M for which Dw is minimum
     add w in M
     for each n not in M
     Dn = min [ Dn, Dw+d(w,n) ]
End
                                                Example Nodes and Link Costs




                              Embedded Linux Experiment                        9
                                  ANT lab. POSTECH
                           M


M




                           M

M




                    M
M
    Embedded Linux Experiment   10
        ANT lab. POSTECH
Bellman-Ford Algorithm
(Backward Search)

 Determines the shortest path from all sources to a single destination
 Algorithm must be executed for each destination




                          Embedded Linux Experiment                      11
                              ANT lab. POSTECH
Embedded Linux Experiment   12
    ANT lab. POSTECH
UDP : User Datagram Protocol (CH 11)

   UDP enables applications to send individual messages to one another.
  The overhead to set up and take down a connection is avoided by
  simply sending query and response.
  UDP is a perfect building block for constructing monitoring,
  debugging, management, and testing.
  UDP provides no reliability. It is up to the application to retransmit the
  query.




                           Embedded Linux Experiment                     13
                               ANT lab. POSTECH
UDP Header




             Embedded Linux Experiment   14
                 ANT lab. POSTECH
                 IP Fragmentation
Bsdi의 MTU가 296이기 때문에 ICMP unreachable message가 발생.
272+272+114로 fragment 하여 보냄.




                       Embedded Linux Experiment     15
                           ANT lab. POSTECH
Example

 No communication between the sender and receiver before the
 first datagram is sent. (No connection set-up)
 No acknowledgments by the receiver.
 The sender has no idea whether the other end receives the
 datagrams.
 Port number 1024~5000 are ephemeral port numbers.




                       Embedded Linux Experiment               16
                           ANT lab. POSTECH
IP Fragmentation
                                        28byte header를
                                        포함하면 1500byte
                                        가 넘음
                                IP ID                뒤에 따라오는
                                                Fragment가 있음




                                              두 번째 fragment가
                                                시작되는 byte



         Embedded Linux Experiment                        17
             ANT lab. POSTECH
TFTP: Trivial File Transfer Protocol

   TFTP Format

         Read Request
         Write Request




    UDP header
   Port No = 69 (처음)
-2번째부터 다른 숫자로 바뀜
                                                         Data length가 511byte
   -동시에 여러 TFTP
                                                       이하이면 final packet으로 인지
    접속 가능하게 함

                                                Ack from receiver
                                                일일이 512byte마다 Ack


                         Embedded Linux Experiment                        18
                             ANT lab. POSTECH
TFTP




       TFTP read request


                    ACK

                    ACK


                  Embedded Linux Experiment   19
                      ANT lab. POSTECH
BOOTP: Bootstrap Protocol




            Embedded Linux Experiment   20
                ANT lab. POSTECH
Embedded Linux Experiment   21
    ANT lab. POSTECH
   자기IP를 모름                                   Client 이름
Client Port No




                                               Gratuitous ARP
      자기IP Addr을
       알고 있음




      ARP로 Server의
      Ether. Addr.을
          알아냄


          TFTP로
       file transfer



                  Embedded Linux Experiment            22
                       ANT lab. POSTECH

								
To top