#!/usr/bin/perl # # $Copyright$ # # $Id: RTU_E_In_null_hmacmd5.seq,v 1.1.1.1 2000/10/31 22:38:52 sekiya Exp $ # ###################################################################### BEGIN { unshift(@INC, '../ipsec/'); $V6evalTool::TestVersion = '$Name: $ '; } use V6evalTool; use IPSEC; %pktdesc = ( ### TBD ); $IF0 = Link0; $IF1 = Link1; #----- check NUT type ipsecCheckNUT(router); #----- set SAD,SPD vLogHTML("*** Target initialization phase ***
"); ipsecClearAll(); ## HOST1 vs NUT ipsecSetSAD( "src=$IPSEC::IPsecAddr{IPSEC_SG1_NET2_ADDR}" , "dst=$IPSEC::IPsecAddr{IPSEC_NUT_NET0_ADDR}" , "spi=0x1000" , "mode=tunnel" , "direction=in" , "protocol=esp" , "ealgo=null" , "eauth=hmac-md5" , "eauthkey=0123456789ABCDEF" , "nsrc=$IPSEC::IPsecAddr{IPSEC_NET4_ADDR}" , "ndst=$IPSEC::IPsecAddr{IPSEC_NET1_ADDR}" , ); #ipsecSetSPD( # "tsrc=$IPSEC::IPsecAddr{IPSEC_SG1_NET2_ADDR}" , # "tdst=$IPSEC::IPsecAddr{IPSEC_NUT_NET0_ADDR}" , # "src=$IPSEC::IPsecAddr{IPSEC_NET4_ADDR}" , # "dst=$IPSEC::IPsecAddr{IPSEC_NET1_ADDR}" , # "upperspec=any" , # "direction=in" , # "protocol=esp" , # "mode=tunnel" , # ); ipsecEnable(); #====================================================================== vLogHTML("*** Target testing phase ***
"); vCapture($IF0); vCapture($IF1); # NET1 NET0 NET2 NET4 # HOST1_NET1 -- NUT -- Router -- SG1 -- HOST1_NET4 # <====tunnel===== ($stat, %ret) = ipsecForwardDecap($IF0, $IF1, 'esptun_from_sg1_net2_echo_request_from_host1_net4_to_host1_net1_on_net0', 'echo_request_from_host1_net4_to_host1_net1_on_net1'); if ($stat ne 'GOT_PACKET') { vLogHTML('TN received no decapuslated packet from NUT
'); ipsecExitFail(); } vLogHTML("TN received decapsulated packet from HOST1_NET4 to HOST1_NET1.
"); ipsecExitPass(); ###################################################################### __END__ =head1 NAME RTU_E_In_null_hmacmd5 - Router Tunnel Mode ESP Inbound NULL with HMAC-MD5 authentication =head1 TARGET Router =head1 SYNOPSIS =begin html
  RTU_E_In_null_hmacmd5.seq [-tooloption ...] -pkt RTU_E_null_hmacmd5.def
    -tooloption : v6eval tool option
  See also RTU_E_common.def and RTU_common.def
=end html =head1 INITIALIZATION =begin html

For details of Network Topology, see 00README

Set NUT's SAD and SPD as following:

                           (Link0) (Link1)
            NET4   NET2      NET0   NET1
  HOST1_NET4 -- SG1 -- Router -- NUT -- HOST1_NET1
                 =====tunnel======>

Security Association Database (SAD)

source address SG1_NET2
destination address NUT_NET0
SPI 0x1000
mode tunnel
protocol ESP
ESP algorithm NULL
ESP authentication HMAC-MD5
ESP authentication key 0123456789ABCDEF

Security Policy Database (SPD)

No SPD entry
=end html =head1 TEST PROCEDURE =begin html
 Tester                      Target                      Tester
              (Link0)                     (Link1)
   |                           |                           |
   |-------------------------->|                           |
   |      ICMP Echo Request    |                           |
   |        (with ESP)         |                           |
   |                           |-------------------------->|
   |                           |      ICMP Echo Request    |
   |                           |                           |
   |                           |                           |
   |                           |                           |
   v                           v                           v
  1. Send ICMP Echo Request with ESP to Link0
  2. Receive ICMP Echo Request from Link1

ICMP Echo Request with ESP to Link0

IP Header Source Address SG1_NET2
Destination Address NUT_NET0
ESP SPI 0x1000
Algorithm NULL
Authentication Algorithm HMAC-MD5
Authentication Key 0123456789ABCDEF
IP Header Source Address HOST1_NET4
Destination Address HOST1_NET1
ICMP Type 128 (Echo Request)

ICMP Echo Request from Link1

IP Header Source Address HOST1_NET4
Destination Address HOST1_NET1
ICMP Type 128 (Echo Request)
=end html =head1 JUDGEMENT PASS: ICMP Echo Request received =head1 SEE ALSO perldoc V6evalTool =begin html
  IPSEC.html IPsec Test Common Utility
=end html =cut