这些小活动你都参加了吗?快来围观一下吧!>>
电子产品世界 » 论坛首页 » 嵌入式开发 » MCU » PPPOE连接试验

共1条 1/1 1 跳转至

PPPOE连接试验

菜鸟
2005-09-21 01:10:46     打赏
两个target之间建立PPPOE连接试验

Title: PPPoE Demonstration Between Two Targets


Introduction:
~~~~~~~~~~~~


PPPoE may be used between two targets, or between a
host and a target. This demonstration shows how to
setup PPPoE between two targets using the Tornado
project facility.


Hardware Configuration:
~~~~~~~~~~~~~~~~~~~~~~
______ _____ _________
| Host |___ | Hub |___| Target 1|
|______| |_____| |_________|
|
___|____
|Target 2|
|________|

Project Configuration for Target 1:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


1) create a bootable project based on the BSP for Target 1.
This example uses the mbx860 reference board.

2) Click on the vxWorks tab in the Workspace window, and
Include the PPPoE component.
- network components->networking protocols-> remote access framework
->PPP over Ethernet
- project errors will appear because PPPoE parameters need to
be set.

3) right-click on the 'PPP over Ethernet' component to set the associated
parameters. Select the 'Properties' item. A Properties window will
appear; click on the 'Params' tab to set each parameter. Set the following
properties:

PPPOE_DEV_NAME "cpm" /* use your ethernet device name */
PPPOE_DEV_UNIT "0" /* use your ethernet device number */
PPPOE_MAX_SERVICES 5 /* use the default setting */
PPPOE_OPERATING_MODE PPPOE_HOST_MODE
PPPOE_SERVICE_NAME "gold"

4) It's not necessary, but the DNS Resolver parameters may also be set
at this time. This component is included in the vxWorks image when
PPPoE is included. The resolver domain, and the IP address of the
domain name server should be set.

Click on the vxWorks tab within the workspace window. Select:
networking protocols->network applications->DNS resolver
right-click on the DNS resolver component, and select properties.
Click on the Params tab. Finally, set the following parameters
to match the domain name and IP address of your network:

RESOLVER_DOMAIN "windriver.com"
RESOLVER_DOMAIN_SERVER "147.11.1.11"

5) Modify usrAppInit.c as follows:

/* adde the following global variables above usrAppInit() */
int myHandle = 0;
extern int pppOeSysProfile;
extern int *applCallbacks;

/* within usrAppInit(), add the following line */
pppOEServiceNameAdd(pppOeSysProfile,"gold",&applCallbacks,&myHandle);

6) Modify /target/config/comps/src/vxWorks/net/usrBasicPPPoECfg.c
as follows:

#define PPPOE_OPERATING_MODE PPPOE_HOST_MODE
#define PPPOE_DEV_NAME "cpm"
#define PPPOE_DEV_UNIT 0


7) Add /target/src/ppp/unsupported/pppAppl.c to the project.

8) rebuild the project


9) Start the ftp server on the host, adjust the bootline on the
target to boot the vxWorks image created by the project, and
boot the target.

10) Initialize Target #2 after following the instructions in the
next section.

11) Type the following at the target shell prompt:
-> myHandle = 1
-> pfwStackAdd(pppOeSysProfile,&applCallbacks,&myHandle);

Watch for a successful connection with Target 2 as shown
below:

-> myHandle = 1
-> pfwStackAdd(pppOeSysProfile,&applCallbacks,&myHandle)
value = 2714048 = 0x2969c0
-> Stack 0x2969c0 is ready
Opening PPP connection on stack 0x2969c0
Time in seconds for establishing connection is 0.016667
Opened PPP connection on stack ID 1


-> ifShow("ppp")
ppp (unit number 1):
Flags: (0x80f1) UP POINT-TO-POINT MULTICAST RUNNING
Type: PPP
Internet address: 10.0.0.2
Destination Internet address: 10.0.0.1
Netmask 0xff000000 Subnetmask 0xffffffff
Metric is 0
Maximum Transfer Unit size is 1492
0 octets received
0 octets sent
0 packets received
0 packets sent
0 non-unicast packets received
0 non-unicast packets sent
0 unicast packets received
0 unicast packets sent
0 input discards
0 input unknown protocols
0 input errors
0 output errors
value = 21 = 0x15
->
-> pppOESessionListShow(pppSysFramework)
Session ID Stack ID
---------- ---------
2 1
value = 19 = 0x13


-> ping "10.0.0.1",1
10.0.0.1 is alive
value = 0 = 0x0
->


######################################################################

Project Configuration for Target 2:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


1) create a bootable project based on the BSP for Target 2.
This example uses the wrSbc8260 reference board.

2) Click on the vxWorks tab in the Workspace window, and
Include the PPPoE component.
- network components->networking protocols-> remote access framework
->PPP over Ethernet
- project errors will appear because PPPoE parameters need to
be set.

3) right-click on the 'PPP over Ethernet' component to set the associated
parameters. Select the 'Properties' item. A Properties window will
appear; click on the 'Params' tab to set each parameter. Set the following
properties:

PPPOE_DEV_NAME "motfcc" /* use your ethernet device name */
PPPOE_DEV_UNIT "0" /* use your ethernet device number */
PPPOE_MAX_SERVICES 5 /* use the default setting */
PPPOE_OPERATING_MODE PPPOE_AC_MODE
PPPOE_SERVICE_NAME "gold"

4) It's not necessary, but the DNS Resolver parameters may also be set
at this time. This component is included in the vxWorks image when
PPPoE is included. The resolver domain, and the IP address of the
domain name server should be set.

Click on the vxWorks tab within the workspace window. Select:
networking protocols->network applications->DNS resolver
right-click on the DNS resolver component, and select properties.
Click on the Params tab. Finally, set the following parameters
to match the domain name and IP address of your network:

RESOLVER_DOMAIN "windriver.com"
RESOLVER_DOMAIN_SERVER "147.11.1.11"

5) Modify usrAppInit.c as follows:

/* adde the following global variables above usrAppInit() */
int myHandle = 0;
extern int pppOeSysProfile;
extern int *applCallbacks;

/* within usrAppInit(), add the following line */
pppOEServiceNameAdd(pppOeSysProfile,"gold",&applCallbacks,&myHandle);

6) Modify /target/config/comps/src/vxWorks/net/usrBasicPPPoECfg.c
as follows:

#define PPPOE_OPERATING_MODE PPPOE_AC_MODE
#define PPPOE_DEV_NAME "motfcc"
#define PPPOE_DEV_UNIT 0


7) Add /target/src/ppp/unsupported/pppAppl.c to the project.

8) rebuild the project


9) Start the ftp server on the host, adjust the bootline on the
target to boot the vxWorks image created by the project, and
boot the target.

10) Proceed back to step 10 in the procedure for Target 1, then
watch for a successful connection with Target #2.


11) The following should be seen at the console of Target #2:


-> i


NAME ENTRY TID PRI STATUS PC SP ERRNO DELAY
---------- ------------ -------- --- ---------- -------- -------- ------- -----
tExcTask excTask f7e718 0 PEND 1f94a4 f7e5f8 0 0
tLogTask logTask f7bd30 0 PEND 1f94a4 f7bc20 0 0
tShell shell d8b4c8 1 READY 1b80fc d8b0a8 0 0
tWdbTask wdbTask d8d740 3 PEND 1b2f18 d8d610 0 0
tNetTask netTask ea2390 50 PEND 1b2f18 ea22a0 0 0
SYS_PPP_C_11bea74 da20c0 80 PEND 1b2f18 da1f80 0 0
SYS_PPP_D_11be9b8 da6b50 85 PEND 1b2f18 da6a20 0 0
value = 0 = 0x0
->


-> Stack 0xd98478 is ready
Opening PPP connection on stack 0xd98478
Time in seconds for establishing connection is 0.016667
Opened PPP connection on stack ID 2


-> ifShow("ppp")
ppp (unit number 2):
Flags: (0x80f1) UP POINT-TO-POINT MULTICAST RUNNING
Type: PPP
Internet address: 10.0.0.1
Destination Internet address: 10.0.0.2
Netmask 0xff000000 Subnetmask 0xffffffff
Metric is 0
Maximum Transfer Unit size is 1492
0 octets received
0 octets sent
0 packets received
0 packets sent
0 non-unicast packets received
0 non-unicast packets sent
0 unicast packets received
0 unicast packets sent
0 input discards
0 input unknown protocols
0 input errors
0 output errors
value = 21 = 0x15
->
-> pfwStackListShow(pppSysFramework)
ID Obj Status
------ -------- ---------
1 d98430 PFW_STACK_ADD_IN_PROGRESS: pending on PPP_O_ETHERNET
2 d98478 PFW_STACK_READY
value = 0 = 0x0
-> pppOEServiceListShow(pppSysFramework)
Service Name Stack ID
------------- -------------
gold 0x1
value = 18 = 0x12
-> pppOESessionListShow(pppSysFramework)
Session ID Stack ID
---------- ---------
2 2
value = 19 = 0x13
->


-> ping "10.0.0.2",1
10.0.0.2 is alive
value = 0 = 0x0
->




关键词: PPPOE     连接     试验     Target     vxWork    

共1条 1/1 1 跳转至

回复

匿名不能发帖!请先 [ 登陆 注册 ]