레이블이 TCP/IP Offload Engine인 게시물을 표시합니다. 모든 게시물 표시
레이블이 TCP/IP Offload Engine인 게시물을 표시합니다. 모든 게시물 표시

2015년 7월 1일 수요일

WIZwiki_W7500

Overview

WIZwiki-W7500은 WIZnet의 W7500을 기반으로한다. “Internet Offload Platform for IoT”을 표방하는 W7500 chip은 ARM Cortex-M0에 TCP/IP Offload Engine(TOE)를 SoC한 one-Chip Soulution이다. W7500은 TOE를 장착하고 있기 때문에 ARM Corte-M0로 Software TCP/IP의 지원없이도 Internet에 간단히 접속할 수 있습니다.

또한, WIZwiki_W7500은 Arduino Shield와 pin Compatible로 Arduino Shield를 사용하는데 용이하다. 그리고 CMSIS-DAP USB를 지원하여 ARM mbed Web-IDE에서 Programming과 Virtual-Serial Port를 지원하며, Keil/IAR의 IDE를 과는 Programming물론 Debugging이 가능하다.

Block Diagram

WIZwiki_W7500_block

WIZwiki_W7500은 그림과 같이 크게 W7500, CMSIS-DAP, Ethernet port(RJ45)+PHY 3부분으로 구성된다.

  • W7500

     ARM® Cortex™-M0 Core기반에 다수의 peripherals포함하고 있다.  다른 Vendor의 Microcontroller들과 차이점은 peripherals 중 MAC laye가 포함된 TCP/IP Offload Engine(TOE)를 탑재하고 있다는 것이다. 
    
  • CMSIS-DAP

      간단하게 Debugger Interface로 이해하면 된다. LPC11u35칩에 W7500의 program algorithm 내장한 CMSIS-DAP는 개발용 PC와 USB Cable를 통해 연결된다. 연결된 PC쪽에서는 WIZwiki_W7500 Board를 USB Drive인식 하도록 되어 있다. 물론 이를 위에 아래에 "How to write the firmware"참고하여 CMSIS-DAP용 Driver를 PC에 인스톨해야한다. USB Driver에 Bin을 Copy하는 식으로 Firmware의 업데이트가 가능하다. 또한 CMSIS-DAP은 Virtual COM를 지원하기 때문에 USB-to-Serial Port없이 CMSIS-DAP port로 WIZwiki_W7500의  UART Output/Input를 Control할 수 있다. 
     CMSIS-DAP의 Algorithm의 변경은 LPC11u35칩의 Firmware를 update하면 되며 아래의 "How to write the firmware to CMSIS-DAP"를 참고한다. 
    
  • RJ45+PHY

      이 부분은 Ethernet PHY Layer로 W7500은 PHY를 내장하지 않기 때문에 Internet에 연결하기 위해 External PHY가 반드시 필요하다. 
    

Features

  • WIZnet W7500
  • ARM® Cortex™-M0 Core upto 48MHz
  • 128KB Flash memory
  • 16KB to 48 KB SRAM
  • Hardwired TCP/IP Core (8 Sockets, MII: Medium-Independent Interface)
  • 12-bit, 8ch ADC
  • 53 I/Os
  • 1ch Watchdog, 4ch Timers and 8ch PWM
  • 3ch UART
  • 2ch SPI
  • 2ch I2C
  • Arduino form-factor
  • Compatible with a wide range of commercially available shields
  • CMSIS-DAP interface firmware
  • Built-in USB drag ‘n’ drop FLASH programmer
  • USB Virtual COM port for serial terminal
    • CMSIS-DAP interface for programming and debugging from offline tools

Pinout

pin map

Resources on ARMmbed

2015년 2월 16일 월요일

Firewall SoC with TCP/IP Offload Engine for Internet of Things

There is no doubt that the number of IoTs will increase explosively.

>Gartner, Inc. forecasts that 4.9 billion connected things will be in use in 2015, up 30 percent from 2014, and will reach 25 billion by 2020.

As the IoT device continues to increase, IoT devices will be faced with the network flooding attack, such as DDoS, more frequently. However, because of its capacity of memory and MCU, nearly most IoT devices are very vulnerable to heavy network attacks and traffisc.

Weakness of these IoT device must be a great opportunity to TOE-embedded MCU, W7500. While TOE under Network attack is to reduce the MCU and memory resources of IoT device, because it is possible to protect the System of IoT device.

What is Firewall TCP/IP offload Engine for IoT?

Software TCP/IP stack

First, let’s examine the Software TCP/IP stack.

Software TCP/IP stack implemented on host system requires more capacity of extra memory and extra processing power for network communications. Normally, ARM Cortex-M core copies data from Ethernet MAC buffer to memory, analyze the received packets in memory using the software stack and then executes an appropriate process.

Software TCP/IP Stack

If network flooding attack has occurres, Cortex-M will repeatedly excute process in order to process flooding packets. Therefor, excessive number of TCP requests such as SYN-flooding attacks will overload the IoT device.

Hardware TCP/IP TOE

Hardware TCP/IP TOE

On the other hand, the hardware TCP/IP TOE, which is implemented as Hardwired logic from Ethernet MAC Layer to TCP/IP Layer, is able to protect IoT system against network attack under excessive number of flooding packet by making discard flooding packets detected.

Comparison of Software TCP/IP stack and Hardware TCP/IP TOE under the Network attack such as DDoS.

Hardware TCP/IP SoC

This means that Cortex-M does not have to handle the flooding packet even under Network attack. Further, because the TCP / IP stack processing is performed in TOE, it is possible to save the amount of memory for TCP/IP communications.

These TOE features are not to limited to the Network attack, it is also possible to expect the same performance under heavy network traffic.

We compared the network performance of software TCP/IP stack and Hardware TCP/IP TOE under DoS Attack (Syn-flood attack).

Comparison of Software and Hardware TCP/IP System
Software TCP/IP Hardware TCP/IP
Platform Pic. mbed1768 W7500_EVB
Platform Name mbed1768 W7500 EVB
Max Clock (MHz) 96 48
Flash (KB) 512 128
RAM (KB) 64 32
Use DMA O O
software RTOS + lwIP Non-OS + Fireware
Code size (KB) Flash:64.5 / RAM:35.2 Flash: 9.09 / RAM: 8.99
Compiler Web-compiler (mbed.org) keil
Test tools Iperf.exe, scapy (python)
Network configurations for Network Performancs tests

Network config

How to use iperf

>Iperf is a tool to measure maximum TCP bandwidth, allowing the tuning of various parameters and UDP characteristics. Iperf reports bandwidth, delay jitter, datagram loss.

https://iperf.fr/

# ex.) host IP(192.168.77.34):port[5000], display format is Mbit/sec, interval 1 sec.
iperf.exe -c 192.168.77.34 -p 5000 -f m -i 1
  • -c : —client host, -c will connect to the host specified.
  • -p : —port #, the server port for the server to listen.
  • -f : —format [], ‘m’ = Mbit/sec
  • -i : —interval #, Sets the interval time in seconds between periodic bandwidth through performance
Scripts for DoS Attack (Syn-flood attack)

We used the scapy (python library) as DoS Attack.

Scapy is a powerful interactive packet manipulation program. It can easily handle most classical tasks like scanning, tracerouting, probing, unit tests, attacks or network discovery.
http://www.secdev.org/projects/scapy/

from scapy.all import
inter = input('inter(time in seconds to wait between 2packets) :')

def synFlood(src, tgt, inter):
    IPlayer = IP(src, dst=tgt)
    TCPlayer= TCP(sport=3000, dport=3000) # as your env. change source and destination port
    pkt = IPlayer / TCPlayer
    send(pkt, loop=1, inter=inter) #

#send(pkts, inter=0, loop=0, verbose=None)
#    Send packets at layer 3, using the conf.L3socket supersocket. pkts can
#    be a packet, an implicit packet or a list of them.
#    loop: send the packets endlessly if not 0.
#    inter: time in seconds to wait between 2 packets
#    verbose: override the level of verbosity. Make the function totally silent when 0.
#   * Refer to http://www.secdev.org/projects/scapy/files/scapydoc.pdf for more detail.

# as your env. change to real IP address and so on.
src = "192.168.77.253" # PC IP address
tgt = "192.168.77.34"  # target board
synFlood(src, tgt, inter)

Network performance

Network_performance

It is possible to prove that the network performance of Hardware TCP/IP TOE is better and more stable than software TCP/IP stack under SYN flood attack. In particular, when interval is 0.001sec., the network performance of TOE is 9 times better than the software TCP/IP stack even though the platform embedded software TCP/IP stack is better than TOE platform.

It is confirmed that the Hardware TCP/IP TOE is able to maintain the network performance even if SYN-flood attack is increased. Otherwise, it is possible to observe that the network performance of software TCP/IP stack became extremely worse according to the interval of SYN-attack.