레이블이 dynagen인 게시물을 표시합니다. 모든 게시물 표시
레이블이 dynagen인 게시물을 표시합니다. 모든 게시물 표시

2008년 3월 22일 토요일

Dynamips / Dynagen Tutorial 번역/요약

비공개 상태에서 번역을 하다가 완성본 상태로 공개를 하려했었는데
중간에 한국에 다녀오느라 공백이 있다보니 내용에 대한 감각도 떨어지고,
막상 번역을 하려니 적당한 단어를 찾는 데 소요되는 시간이 많아지는 것같아
일단 작업을 중단하고 공개로 전환한다. 물론 여전히 조금씩은 update하고 있는 중이다.

Tutorial Summary

Introduction
  • Dynamips는 Cisco 1700, 2600, 3600, 3700, 7200 Series Router Hardware Platform을 emulate하고, Standard IOS image들을 구동시킨다.
  • Dynamips는 Simple Virtual Switch를 제공하긴 하지만, Catalyst Switch들을 emulate하지는 않는다. (NM-16ESW[16-port 10/100 EtherSwitch Network Module]을 emulate해준다.)
  • Dynagen은 Dynamips와의 Communication을 위해 "Hypervisor" Mode를 사용하는 Frontend for Dynamips이다.
  • Workstation에서 구동되고 있는 Dynagen을 가지고 Back-End Server에서 구동되고 있는 Dynamips와 Communication하며 Client/Server Mode로 작동시킬 수 있다.
    Dynagen은 또한 여러 대의 Computer들을 가로지르는 커다란 Virtual Network들을 분산시키기 위한 다수의 Dynamips Server들을 동시에 control할 수 있다.
    물론 Dynamips와 Dynagen을 동일한 System에서 구동시키는 것도 가능하다.

Installing
  • Python으로 작성된 Dynagen은 Python을 지원하는 어떠한 Platform에서도 구동된다. 즉, 거의 모든 Platform에서 사용가능하다.
    Dynagen의 Windows Installer Package에는 Dynamips와 (Python을 별도로 설치할 필요가 없도록 미리) compile된 Dynagen이 포함되어 있다.
  • 우선 Dynamips를 구동시키고자 하는 System에는 libpcap(Linux)이나 winpcap 4.0이상(Windows)이 설치되어 있어야한다. 이것들은 Bridging Router Interfaces를 Physical Network Cards에 제공하는 데 사용된다.
  • Windows 사용자는 Dynamips/Dynagen을 구동시키기 위해 필요한 모든 것을 제공하는  Windows Installer Package(Dynagen Homepage에서 Download)를 설치하면 된다.
    Linux 사용자는 Dynamips Binary와 Dynagen Tarball을 Download하여 압축을 해제하고 적절한  곳에 위치시킨  후, PATH가 설정된 곳(Ex. /usr/local/bin)에 Dynamips와 Dynagen의 실행파일의 Symbolic Link를 만들어 준다.
    최신 Build의 Dynamips는
    Blog에서, Dynagen은 Homepage의 Interim Build Section에서 찾을 수 있다.

IOS Image

  • Dynamips는 real Cisco IOS images를 구동시킨다.
  • Windows에서는 C:\Program Files\Dynamips\images가 default로 정해져 있는 image 위치이다. 여기에 있지 않다고 사용할 수 없는 것은 아니지만, Sample Lab들은 이곳을 참조하도록 구성되어있다.
    Linux/Unix System에서는 image를 저장할 위치(Ex. /opt/images)를 지정하고 그곳에 image를 위치시키면 된다.
  • Cisco IOS image는 압축되어있다. 이 압축된 image들은 그 자체로써도 Dynamips와 잘 동작한다.
    (예외: Cisco 2600 Series Router들의 image는 Dynamips와 동작하기 위해 반드시 압축을 해제해야만한다.)
    그렇지만 실제 Router에서와 마찬가지로 압축해제 과정으로 인해 Boot Process는 상당히 지연된다.
    그러므로 사전에 image의 압축을 해제하는 것이 좋다.
    Linux/Unix/Cygwin에서는 unzip을 이용하여 다음과 같이 압축을 해제할 수 있다:
    Ex.) unzip -p c7200-g6ik8-mz.124-2.T1.bin > c7200-g6ik8-mz.124-2.T1.image
    원래 압축되기 전의 원본이름은 더 간단하게 되어 있지만 그대로 사용하면 image들을 구분하기에 충분하지 못하므로 위와같이 압축된 Binary에서 사용한 이름에 Extension만 image로 바꿔주는 것이 좋다.
    이렇게 명령을 주면 unzip으로부터 경고메시지를 받게 되지만, 무시해도 된다.
    Windows에서는 WinRar를 이용하여 간단하게 압축을 해제할 수 있다.

Resource Utilization

  • Dynamips는 Emulation작업을 수행하기 위해 상당량의 RAM과 CPU를 사용한다.
    만약 실제 Cisco 7200 Router 상에서 256MB RAM을 요구하는 IOS image를 사용하고자 한다면 이 image를 사용하는 Virtual Router Instance는 256MB RAM을 차지하게 된다.
    Dynamips는 또한 JIT Translations Cache를 위해 Default로 64MB RAM(Unix) / 16MB RAM(Windows)을 할당한다.
  • Default로서 Dynamips는 Router의 Virtual Memory를 위해 Memory Mapped Files를 사용하기 때문에 보통 실제 System에서 사용되는 RAM의 양은 현저하게 적을 것이다. 작업 Directory 안에서 Virtual Router의 RAM size와 동일한 크기의 임시 "ram" Files를 볼 수 있을 것이다.
    만약 System에 충분한 양의 RAM을 갖고 있다면, 그리고 자신이 무엇을 하는지를 알고 있다면, 자신의 labs의 Instance들을 위한 mmap을 disable시키기 위해 device default 또는 router Section에서 "mmap=false"로 설정하라.
  • Dynamips는 또한, Router CPU를 instructin-by-instruction으로 emulating하고 있기 때문에, 다량의 CPU 자원을 사용한다. 당초에 Dynamips로서는 언제 Virtual Router의 CPU가 idle 상태가 되는 지 알 방법을 갖고 있지 않으므로 실제 작업을 수행하는 instructions를 실행하듯이 IOS의 idle routines를 구성하는 모든 instructions를 충실하게 실행하게된다. 그렇지만 주어진 IOS image를 위한 "Idle-PC" process를 통해 CPU 사용은 극적으로 줄어들게 될 것이다.

Configuring your Telnet Client
  • Dynagen은 CLI로부터 직접 Virtual Router Console에 접속할 수 있도록 해주는 Console command를 포함하고 있다. 그렇지만 우선 어떤 Telnet client를 사용할 것인지를 dynagen.ini(Windows System의 경우 C:\Program Files\Dynagen에, Unix System의 경우 Dynagen의 Tarball을 풀어 놓은 곳에 위치)에 설정해줘야만 한다. 여기에서 적절한 Line을 uncomment시키거나 원하는 Telnet client를 사용하기 위한 내용을 추가시켜준다.

Network Files
  • Dynagen은 모든 Router, Switch 그리고 Virtual lab을 구성하는 Interconnections의 설정을 저장하기 위해 하나의 단일 "network file"을 사용한다. "Dynagen Sample Labs"에서 몇몇 sample network file들을 찾아볼 수 있다.

Runnig Simple Lab #1

  • Virtual lab을 실행시키기 위해, 먼저 local machine에 Dynamips Server를 구동시킨다.('listening on port 7200'로 구동되는 것이 Default)
  • 이렇게 Dynamips Server가 구동된 상태에서 Dynagen이 simple1.net file을 읽어들이면 이 가상의 Network가 시작된다.
  • Dynamips Server를 구동시키고 Dynagen이 network file을 읽어들이도록 하는 구체적인 방법은 운영체제에 따라 달라진다. 자세한 내용은 영문 Tutorial을 참조.
  • 이 상태에서 Dynagen이 simple1.net을 다 읽어들이고 나면 "Warning: Starting [Routers] with no idle-pc value"와 같은 경고 메시지가 출력되면서 Virtual lab이 시작되고 Dynagen management console이 열린다.(Prompt는 =>)

2007년 12월 15일 토요일

Dynamips / Dynagen Tutorial

Dynamips / Dynagen Tutorial
Documentation Revision 1.11.2

한 블로그에서 Tutorial의 번역판을 우연히 찾게 되었다.
번역이 불완전하긴 하지만 원본의 문서가 양이 많아서 읽어보려면 상당한 시간이 걸리므로
우선은 시간을 좀 절약할 수 있지 않을까 해서 스크랩해둔다.
이것은 Documentation Revision 1.9.1을 번역한 것이다.

more..


[Related Article]
2007/12/17 - [Network/Router Simulation] - Dynamips / Dynagen Tutorial 번역/요약
2007/12/13 - [Network/Router Simulation] - Cisco 7200 Simulator - Dynamips

2007년 12월 13일 목요일

Cisco 7200 Simulator - Dynamips

[Project Homepage]

Introduction

The Project was started in August 2005 to emulate a Cisco 7200 on a traditional PC.
Now, it also supports Cisco 3600 series (3620, 3640 and 3660), 3700 series (3725, 3745) and 2600 series (2610 to 2650XM, 2691).

The goals of this emulator are mainly:

    * To be used as a training platform, with software used in real world.
    * Test and experiment the numerous and powerful features of Cisco IOS.
    * Check quickly configurations to be deployed later on real routers.

Of course, this emulator cannot replace a real router: you should be able to get a performance of about 1 kpps (depending on your host machine), to be compared to the 100 kpps delivered by a NPE-100 (the oldest NPE model). So, it is simply a complementary tool to real labs for administrators of Cisco networks or people wanting to pass their CCNA/CCNP/CCIE exams.

Current status

At this time, the emulator I have programmed is able to boot a large number of Cisco IOS releases available for the 7200, 3600, 3700 and 2600 platforms, including the latest 12.2S and 12.4T.

The following devices are emulated in the current release (0.2.7):

  • MIPS64 and PowerPC CPU processors. The instruction sets are not completely emulated now (MIPS FPU support is lacking, TLB support is not finished and other minor things), but it is sufficient for IOS ;
  • DRAM and Packet SRAM memory ;
  • Non-Volatile Memory (NVRAM) ;
  • Signetics SCN 2681 DUART (C7200 Console and AUX ports) ;
  • National Semiconductors NS16552 DUART (C3600/C3700/C2600 Console and AUX ports) ;
  • Dallas DS1620 Temperature Sensors and Voltage Sensors, allowing the C7200 Environmental Monitor to work properly ;
  • NMC93C46 Serial EEPROM ;
  • Bootflash of 8 Mb (Intel 28F016SA) ;
  • Galileo GT64010/GT64120/GT96100 PCI controllers, DEC 21x50 PCI bridges and so ;
  • PCMCIA ATA disk emulation (C7200 only at this time).
  • ...

The following Cisco 7200 Port Adapters (PA) are currently supported:

  • FastEthernet cards "C7200-IO-FE" and "PA-FE-TX" based on DEC21140 chip
  • FastEthernet cards "C7200-IO-2FE" and "PA-2FE-TX" based on Intel i8254x chips
  • GigabitEthernet cards "C7200-IO-GE-E" and "PA-GE" based on Intel i8254x chips
  • Ethernet cards "PA-4E" and "PA-8E" based on AMD Am79c97x chips
  • ATM card "PA-A1" based on Texas Instruments Tneta1570 chip
  • Serial cards "PA-4T+" and "PA-8T"
  • POS (Packet over SONET) card "PA-POS-OC3" (experimental, only works with recent IOS images)

The following Cisco 3600 (3620,3640,3660) Network Modules (NM) are currently supported:

  • Ethernet cards: "NM-1E", "NM-4E" and "NM-1FE-TX", all based on AMD Am79c97x chips
  • Ethernet switching module: "NM-16ESW"
  • Serial card "NM-4T"

The following Cisco 2691/3725/3745 Network Modules (NM) are currently supported:

  • FastEthernet cards: "NM-1FE-TX"
  • Ethernet switching module: "NM-16ESW"
  • Serial card "NM-4T"

The following Cisco 2600 Network Modules (NM) are currently supported:

  • Ethernet cards: "NM-1E", "NM-4E" and "NM-1FE-TX"
  • Ethernet switching module: "NM-16ESW"

Lab simulation / "Hypervisor" mode

It is now possible to run the emulator as an "Hypervisor" to start and control many virtual router instances simultaneously.

Dynagen, is a front-end (written in Python) that makes lab simulation with the hypervisor very easy: it uses an INI-like configuration file to provision Dynamips emulator networks.
It takes care of specifying the right port adapters, generating and matching up those pesky NIO descriptors, specifying bridges, frame-relay, ATM switches, etc.
It also provides a management CLI for listing devices, suspending and reloading instances, etc.
You can also distribute virtual instances across different servers to set up complex labs. To begin with Dynagen, you can consult this very complete tutorial.

Dynagui is a graphical front-end. It uses Dynagen to communicate with the hypervisor.


How to use it ?

Very important remark: by default, an instance will take 100% of the host CPU.
To avoid this, please read the "idle-pc" section in the README.

Emulated hardware
The emulator currently supports the following platforms:
   - Cisco 7200 (NPE-100 to NPE-400)
   - Cisco 3600 (3620, 3640 and 3660)
   - Cisco 2691
   - Cisco 3725
   - Cisco 3745
   - Cisco 2600 (2610 to 2650XM)
   - Cisco 1700 (1710 to 1760)

By default, a Cisco 7206VXR with NPE-200 (256 Mb of DRAM) is emulated.
To emulate another platform, use the "-P" command line option
(for example, "-P 3725" or "-P 3600").

For the 7200, you can change the NPE type with the "-t" option.
It is possible to select "npe-100", "npe-150", "npe-175", "npe-200", "npe-225", "npe-300" and "npe-400". The "npe-g1" is not working.

For the 3600, a 3640 with 128 Mb is emulated by default.
You can change this with the "-t" option and by specifying "3620" or "3660".
Don't forget to set the chassis type depending on your IOS image, a c3660 image will not run on c3640 hardware and vice-versa.

Remark: PCMCIA card emulation is not supported yet with Cisco 3600.

Command Line Options details
--idle-pc <pc>
:
The "idle PC" feature allows you to run a router instance without having a 100% CPU load. This implies that you can run a larger number of instances per real machine.
To determine the "idle PC", start normally the emulator with your Cisco IOS image, and a totally IOS empty configuration (although not mandatory, this will give better results).
When the image is fully booted, wait for the "Press RETURN to get started!" message prompt, but do not press Enter key.
Wait about 5 seconds, then press "Ctrl-] + i".
Some statistics will be gathered during 10 seconds.
At the end, the emulator will display a list of possible values to pass to the "--idle-pc" option.
You may have to try some values before finding the good one.
To check if the idle PC value is good, just boot the Cisco IOS image, and check your CPU load when the console prompt is available.
If it is low, you have found a good value, keep it preciously.
Important remarks: 
* An "idle PC" value is *specific* to a Cisco IOS image.
   You cannot boot a different IOS image without proceeding as described above.
* Do not run the process while having the "autoconfiguration" prompt.

To boot quickly, the preferred method is to decompress the IOS image with the "unzip" utility.
It avoids to run the self-decompressing process in the emulator.

$ unzip -p c7200-advipservicesk9-mz.124-9.T.bin > image.bin
warning [c7200-advipservicesk9-mz.124-9.T.bin]: 27904 extra bytes at beginning or within zipfile
(attempting to process anyway)
$ file image.bin
image.bin: ELF 32-bit MSB executable, cisco 7200, version 1 (SYSV), statically linked, stripped

You can ignore the warning, unzip has just skipped the self-decompressing code at the beginning of the image.


Cisco 7200 Simulator FAQ