Introduction to KENS KAIST Educational Network System by JasonDetriou

VIEWS: 22 PAGES: 22

									    Introduction to
KENS: KAIST Educational
   Network System
       2005. 3.15
     TA: Hyunju Jin
      NCLab, KAIST
                                       KENS’ Objective
For OS,                                              For Network,
You can learn locking,                               You can learn sliding
  paging, and scheduling in                            windows and congestion
  a book                                               control in a book

                        NACHOS                                KENS

but you can UNDERSTAND                               but you can UNDERSTAND
  them from implementing                               them from implementing
  NACHOS                                               KENS

Korea Advanced Institute of Science and Technology
Network Computing Laboratory
                                             What is KENS?
• KAIST Educational Network System
  Simulates the basic components of an
  operating system kernel, as well as the
  transport, network and data link layer
• Students can implement TCP/IP stack
  without modifying the kernel.



Korea Advanced Institute of Science and Technology
Network Computing Laboratory
                                                     Your KENS

  Internet Protocol Stack                              In Practise        KENS


        Application Layer                               HTTP, FTP    Your HTTP, Your FTP

          Transport Layer                                  TCP          Your TCP
           Network Layer                                    IP             Your IP

                Link Layer

            Physical Layer



Korea Advanced Institute of Science and Technology
Network Computing Laboratory
                                         A Real Network




                                                                      10
                                                                       .3
                                                                           0.
                                                                             0.
                                                                             1
                                                           se
                                                                th0




                                         seth0




                                                                                              10
                                                                                               .3
                                                       Router 1




                                                                                                   0.
                                 Alpha




                                                                                                    0.
                                                                                                       2
                                                            seth1

                                                                                   se
                                                                                        th1
                           143.248.0.2               143.248.0.1



                                                                                                                  seth0

                                                                              Router 2                     Beta
                                                                                  seth0


                                                                            10.20.0.1                      10.20.0.2



Korea Advanced Institute of Science and Technology
Network Computing Laboratory
            In KENS running on a single
                     computer
                  One virtual node




                                                                      10
                  One real process




                                                                       .3
                                                                                                           another real process




                                                                           0.
                                                                             0.
                                                                             1
                                                           se
                                                                th0


                            KENS                     KENS                                                            APP
                                         seth0




                                                                                              10
                                                                                               .3
                                                       Router 1




                                                                                                   0.
                                 Alpha




                                                                                                    0.
                                                                                                       2
                                                            seth1

                                                                                   se
                                                                                        th1
                           143.248.0.2               143.248.0.1


              another real process
                                                                             KENS                           KENS
                                                                                                                     seth0

                                                                              Router 2                        Beta
                                                                                  seth0

                              APP
                                                                            10.20.0.1                          10.20.0.2



Korea Advanced Institute of Science and Technology
Network Computing Laboratory
                                   How to start KENS




Korea Advanced Institute of Science and Technology
Network Computing Laboratory
 How to write your web browser
            in KENS




Korea Advanced Institute of Science and Technology
Network Computing Laboratory
                                   KENS Components
•     Kernel Emulator
•     TCP
•     IP
•     Data Link




Korea Advanced Institute of Science and Technology
Network Computing Laboratory
                                                 KENS details
• Common socket?




Korea Advanced Institute of Science and Technology
Network Computing Laboratory
                                  KENS Architecture
                                                     app                        app
                                                                  …….
                                                     lib                         lib

                              Socket System call

                        Common                                Data                       Data
                        socket UDP                         TCPsocket                     socket

                                                             Kernel Emulator
                                                                  TCP
                                 KENS
                                                                   IP
                                                                   DL

                                                     UDP NIC                   UDP NIC
Korea Advanced Institute of Science and Technology
Network Computing Laboratory
                               Implementing ktp.c
• See kernel_main.c, kip.c
• Use ip_output(), ip_input()

                                     app: server     app: client


                                              KE         KE


                                            TCP         TCP
                              ip_input()
                                       ip_output()        ip_input()
                                                                 ip_output()

                                               IP        IP


Korea Advanced Institute of Science and Technology
Network Computing Laboratory
•     ip_output = udt_send(pkt)
•     ip_input = udt_rcv(pkt)
•     xxx = rdt_send(pkt)
•     yyy = rdt_rcv(pkt)




Korea Advanced Institute of Science and Technology
Network Computing Laboratory
    Basic File Transfer Application
• Transmit a 10MB file.




Korea Advanced Institute of Science and Technology
Network Computing Laboratory
                                         IP layer control
• How to add delay/loss?




Korea Advanced Institute of Science and Technology
Network Computing Laboratory
                                    Compile and Run?




Korea Advanced Institute of Science and Technology
Network Computing Laboratory
                                                Specification
• PA#2: reliable mode
         – Network layer delivers all packet which are
           ordered by sequence number
                  • tcp connection state
                  • tcp connection setup, tear down
                           – SYN, ACK, FIN
                  • packet segmentation
                           – sequence number, receive window, tcp_hdr
                  • Sliding window

Korea Advanced Institute of Science and Technology
Network Computing Laboratory
                                                Specification
• PA#3: unreliable mode
         – Packet miss, delay
         – time out, packet reordering, retransmission
• PA#4: congestion control???
         – Congestion window




Korea Advanced Institute of Science and Technology
Network Computing Laboratory
                                                     Reference
•     KENS Install Guide
•     KENS User Guide
•     Implementing TCP Layer in KENS
•     TCP/IP Illustrated, Stevens
•     UNIX Network Programming, Stevens



Korea Advanced Institute of Science and Technology
Network Computing Laboratory
Backup slides
                                                      KENS API

                                                            ksocket(), kbind(), kconnect()




                                                                         KENS
                     socket(), bind(), connect()              socket(), bind(), connect()
User

Kernel




 Korea Advanced Institute of Science and Technology
 Network Computing Laboratory
                                  KENS Architecture

                                                     Common            Host
                                                     socket
        app                lib                           UDP


                                                     Data                             UDP
                 …….




                                                     socket        T
                                                               K              I   D     NIC
                                                         TCP       C
                                                               E              P   L
                                                     Data          P
         app                lib                      socket                           UDP
                                                                                        NIC



Korea Advanced Institute of Science and Technology
Network Computing Laboratory

								
To top