Sabtu, 09 Mei 2009

java

LAPORAN PRAKTIKUM

PEMROGRAMAN JAVA II

MODUL 3

EVENT HANDLING



UPN


Disusun oleh:

pandu

123060130

Assisten / Coass


JURUSAN TEKNIK INFORMATIKA

FAKULTAS TEKNOLOGI IDUSTRI

UPN “VETERAN” YOGYAKARTA

2008

Listing Program

package Kalimat;

import java.awt.*;

import java.awt.event.*;

import javax.swing.*;

public class Ganjil extends JFrame implements ActionListener{

JLabel l1,l2,l3;

JTextField tf1,tf2;

JTextArea ta;

JButton b1,b2;

JPanel p,p1,p2,p3;

ScrollPane sp;

int i=1;

String t="";

public Ganjil() {

setTitle("Ganjil");

l1 = new JLabel("Kalimat 1");

l2 = new JLabel("Output");

l3 = new JLabel("Anda Memasukkan kalimat ke-");

tf1 = new JTextField(25);

tf2 = new JTextField(5);

b1 = new JButton("OK");

b2 = new JButton("Cancel");

p = new JPanel(new GridLayout(1, 2));

p1 = new JPanel(new GridLayout(1, 2));

p2 = new JPanel(new GridLayout(1, 2));

p3 = new JPanel(new FlowLayout());

sp = new ScrollPane();

ta = new JTextArea();

sp.setPreferredSize(new Dimension(250,260));

setLayout(null);

p.setBounds(0, 0, 500, 30);

add(p);

p.add(l1);

p.add(tf1);

p1.setBounds(0, 40, 500, 260);

add(p1);

p1.add(l2);

p1.add(sp);

sp.add(ta);

p2.setBounds(0, 310, 500, 30);

add(p2);

p2.add(l3);

p2.add(tf2);

p3.setBounds(0, 340, 500, 40);

add(p3);

p3.add(b1);

p3.add(b2);

setDefaultCloseOperation(3);

setLocation(200, 200);

setVisible(true);

setSize(510, 410);

b1.addActionListener(this);

b2.addActionListener(this);

}

public void actionPerformed(ActionEvent e) {

if(e.getSource()==b1){

String t = tf1.getText();

tf2.setText(String.valueOf(i));

tf1.setText("");

t=t+tf1.getText()+"\n";

if(i%2==0)

ta.append(t.toLowerCase());

else

ta.append(t.toUpperCase());

i=i+1;

}

if(e.getSource()==b2){

System.exit(0);

}

}

public static void main(String[] args) {

new Ganjil();

}

}

Penjelasan Program

package Kalimat;//package kalimat

import java.awt.*;//import dari kelas-kelas java.awt.*

import java.awt.event.*;//import dari kelas-kelas awt.event.*

import javax.swing.*;//import dari kelas-kelas javax.swing.*

public class Ganjil extends JFrame implements ActionListener{ //class ganjil yang di extends dari JFrame dan impelments actionlistener

JLabel l1,l2,l3;//instansiasi l1,l2,l3 dari kelas JLabel

JTextField tf1,tf2;//instansiasi tf1,tf2 dari kelas JTextField

JTextArea ta;//insatansiasi ta dari JTextarea

JButton b1,b2;//instansiasi b1,b2 dari JButton

JPanel p,p1,p2,p3;//instansiasi p dari Jpanel

ScrollPane sp;//instansiasi sp dari kelas scrollPane

int i=1;//deklarasi integer i

String t="";//deklaras t untuk objek bernilai string

public Ganjil() {//konstruktuor

setTitle("Ganjil");//membuat judul

l1 = new JLabel("Kalimat ");//pemberian nama pada l1

l2 = new JLabel("Output");//pemberian nama pada l2

l3 = new JLabel("Anda Memasukkan kalimat ke-");//pemberian nama pada l3

tf1 = new JTextField(25);//pengaturan panjang string pada tf1

tf2 = new JTextField(5);//pengaturan panjang string pada tf2

b1 = new JButton("OK");//pemberian nama pada b1

b2 = new JButton("Cancel");//pemberian nama pada b2

p = new JPanel(new GridLayout(1, 2));//pembuatan panel baru untukp

p1 = new JPanel(new GridLayout(1, 2));//pembuatan panel untuk p1 beserta jenis layout

p2 = new JPanel(new GridLayout(1, 2));//pembuatan panel untuk p2 beserta jenis layout

p3 = new JPanel(new FlowLayout());//pembuatan panel untuk p3 beserta jenis layout

sp = new ScrollPane();//pembuatan scrollPane

ta = new JTextArea();//inisiasi JTextarea

sp.setPreferredSize(new Dimension(250,260));//mengatur dimensi untuk scrollPane

setLayout(null);//mengatur layout

p.setBounds(0, 0, 500, 30);//membuat ukuran untuk p

add(p);//memasukan p pada form

p.add(l1);//memasukan l1 pada p

p.add(tf1);//memasukan tf1 untuk p

p1.setBounds(0, 40, 500, 260);//mengatur ukuran untuk p1

add(p1);//memasukan p1 pada form

p1.add(l2);//memasukan l2 pada p1

p1.add(sp);//memasukan sp pada p1

sp.add(ta);//memasukan ta padda sp

p2.setBounds(0, 310, 500, 30);//mengatur ukuran p2

add(p2);//memasukan p2 pada form

p2.add(l3);//memasukan l3 pada p2

p2.add(tf2);//memasukan tf2 pada p2

p3.setBounds(0, 340, 500, 40);//mengatur ukuran p3

add(p3);//memasukan p3 pada form

p3.add(b1);//memasukan b1 pada p3

p3.add(b2);//memasukan b2 pada p3

setDefaultCloseOperation(3);//aksi keluar pada saat tombol close dipencet

setLocation(200, 200);//mengatur letak keluat form pada komputer

setVisible(true);//menampilkan form pada komputer

setSize(510, 410);//mengatur ukuran form yang dipakai

b1.addActionListener(this);//memberi aksi actionlistener pada tombol b1

b2.addActionListener(this);//memberi aksi actionlistener pada tombol b2

}

public void actionPerformed(ActionEvent e) {//deklarasi method actionperformed

if(e.getSource()==b1){//aksi yang akan dilakukan jika tombol b1 diklik

String t = tf1.getText();//menyimpan text pada tf1 pada String t

tf2.setText(String.valueOf(i));//mengluarkan nilai untuk kallimat yang akn dimasukan

tf1.setText("");//mengatur kalimat pada tf1

t=t+tf1.getText()+"\n";//mengambil nilai yang tersimpan pada string t

if(i%2==0)//fungsi untuk menjalnkan modulus

ta.append(t.toLowerCase());//fungsi merubah kalimat jika kalimat genap kan menjadi huruf kecil

else

ta.append(t.toUpperCase());//fungsi merubah kalimat jika kalimat genap kan menjadi huruf besar

i=i+1;//perulangan

}

if(e.getSource()==b2){//aksi yang dilakukan jika tombol b2 diklik

System.exit(0);//aksi keluar

}

}

public static void main(String[] args) {//class mainmenu untuk memanggil konstruktor

new Ganjil();//objek baru untuk menjalnkan program

}

}

Output

BDBO

AI

LAPORAN PRAKTIKUM

IMPLEMENTASI KECERDASAN BUATAN

PERTEMUAN I

DISUSUN OLEH :

PANDU WEDHASMARA

123060130 / Plug 3

Asisten :

ARDA

JURUSAN TEKNIK INFORMATIKA

FAKULTAS TEKNOLOGI INDUSTRI

UNIVERSITAS PEMBANGUNAN NASIONAL ”VETERAN”

YOGYAKARTA

2008

DASAR TEORI

Prolog (Programming in Logic) merupakan bahsa generasi kelima yang dibangun atas dasar pemrograman ilmiah. Pengembang bahasa ini adalah Alain Colmeraur dan P.Roussel di Universitas Marseiles di Prancis pada tahun 1972

Prolog ini dapagt digunakan dalam berbagai aplikasi dengan program menirukan cara berfikir manusia dengan komputer. Aplikasi yang dapat kita ciptakan melalui prolog ini adalah : Sistem pakar, Games, Searching, Pengolahan bahasa alami, robotik, pengenalan pola, machine learning dan lain sebagainya.

Struktur program prolog adalah :

1. Domains / DOMAINS / domains merupakan tempat yang digunakan untuk mendeklarasikan variabel tambahan.

2. Predicates merupakan tempat yang digunakan untuk menulis nam simbolik dari relasi

3. Clauses merupakan tempat yang fakta dan aturannya digunakan dalam program.

Dasar –dasar penggunaan prolog :

1. Fakta : suatu kenyataan. Yang perlu diatur dalam fakta adalah human language, menentukan relasi, translate ke prolog, kemudian simpan file.

2. Aturan atau rules merupakan suatu pernyataan yang menunjukkan bagaimana fakta-fakta berinteraksi satu dengan yang lain untuk membentuk suatu kalimat.

3. Pernyataan suatu kalimat atau pernyataan yang diajukan berdasar fakta dan aturan yang ada.

4. Variabel merupakan besaran yang nilainya dapat berubah-ubah.

LISTING PROGRAM

1. Program 1

domains

nama = symbol

predicates

ayah(nama,nama)

kakek(nama,nama)

clauses

ayah(anang,adi).

ayah(anang,ari).

ayah(adi,budi).

ayah(adi,badu).

ayah(ari,didi).

ayah(ari,dida).

kakek(Namakakek,Namacucu):-

ayah(Namaayah,Namacucu),

ayah(Namakakek,Namaayah).

Langkah Praktikkum

1. Buka program turbo prolog.

2. Pilih files/new file (tekan alt+f, lalu pilih new file)

3. ketik program dalam prolog seperti listing diatas.

4. Tekan F10 untuk kembali ke menu utama.

5. Tekan f9 untuk mengcompile, kemudian perbaiki program jika terdapat kesalah.

6. Tekan alt+r untuk run

7. Masukkan pertanyaan pada goal dialog seperti output di bawah ini.

Pembahasan

Program diatas merupakn program yang digunakan untuk mengetahui hubungan relasi kekerabatan kakek dan ayah. Dalam program terdapat Domains yang dimaksudkan untuk mendeklarasikan variabel dan tipe datanya. Terdapat juga predicates untuk menuliskan nama simbolik dari relasi. Serta terdapat pula clauses untuk menulis fakta dan aturan.

Program diatas disusun berdasar hierarki hubungan kekerabatan seperti berikut

KESIMPULAN

Pada praktikkum ini telah dikenalkan tentang turbo prolog sebuah bahasa pemrograman dengan logic. Dalam prolog ini mempunyai aturan pemakaian yang harus digunakan untuk dapat menjalankan program. Struktur program prolog adalah mempunyai domains, predicates, dan clauses, serta pernyataan goal. Selain itu dalam prolog harus mempunyai dasar seperti fakta, aturan, pernyataan, dan variabel.

Jaringan Komputer

Tugas

Jaringan Komputer

Pembuatan Paper tentang lapisan transport dibeberapa protokol IP atau IPX

Disusun Oleh :

Nama : Pandu Wedhasmara

NIM : 123060130

JURUSAN TEKNIK INFORMATIKA

FAKULTAS TEKNOLOGI INDUSTRI

UNIVERSITAS PEMBANGUNAN NASIONAL “VETERAN’’

YOGYAKARTA

2008

Configuring IPv4 for Gigabit Ethernet Interfaces

Summary

This course will extend your networking knowledge with both theory and practical skills. CISCO CCNP material is included.

Applicants should have gained an Honours Degree with a good covering of computer networking. Applicants should also have some understanding of programming.

The postgraduate diploma involves a taught element comprising 30 weeks of study. Students who complete this successfully may graduate (PgDip), or progress to the MSc dissertation. The dissertation can be taken full-time (15 weeks) or part-time (submit within two years of completion of the diploma).

Overview

The MSc in Advanced Networking is a technical course, intended for those who wish to extend their existing knowledge of computer networks, particularly in the application and deployment of such networks. It is ideally suited to those who wish to pursue a career in the development and use of practical network systems that address real world problems or situations, as well as being a valuable course for those who wish to pursue a career in research either in areas associated with computer networking.

The course core is founded on two primary aspects: modern computer networking practices and current research trends associated with the application and usage of computer networks. The ethos of the course is to extend your existing knowledge of and thinking towards computer networking theory, practice and research.

The course incorporates preparation1 for the Cisco CCNP (Cisco Certified Network Professional). Currently this includes: Remote Access, Routing, Switching, and Troubleshooting.

Throughout the course, a range of issues relevant to enable students to pursue careers as networking professionals. The topics taught as a part of this course are concerned with the design, implementation and administration of high performance computer network infrastructures and includes an evaluation of methods, techniques, tools and technologies used in developing such infrastructures. The course builds on the level of networking knowledge typical

1 It should be noted that the Cisco CCNP examinations are not part of the course. MSc/PG.Dip. Advanced Networking (F/T) Napier University, Edinburgh ©2006, Napier University Page 2 21/12/2006

of undergraduate studies by dealing with complex networks, protocols, tools, services, and devices. Furthermore you will learn about current research topics and will demonstrate an understanding of current research and future research directions.

Course Aims

The aims of this course are:

1. to foster a critical understanding of and evaluative approach to the concepts and principles of a variety of advanced networking topics.

2. to develop a critical understanding and awareness of current research in computer networks and future computer networking trends.

3. to develop a critical understanding and awareness of analysis, design and implementation of computer networks

4. to stimulate an enquiring, analytical, creative, and reflective approach that encourages independent judgement and critical awareness. To demonstrate this in relation to current computer networking research.

5. to further develop abilities to reason logically, work effectively as individuals as well as in a team, communicate clearly and in a way which is acceptable for communicating research ideas to peer groups.

6. to ensure that the student has the basis for both future personal development and for continuing professional development

Employment

A Masters degree in Advanced Networking can open the door to a wide range of careers. Graduates of the course are expected to find employment within a variety of companies as networking professionals. It is expected that some graduates will move into research (e.g. PhD, or as Research Assistants), education, and training.

Admissions

Applicants should have gained an Honours Degree with a good covering of computer networking. Applicants should also have some understanding of programming.

If you have certification in Cisco CCNA then that would be advantageous, although it is not a requirement.

A lower qualification may be considered if accompanied by appropriate work experience.

Potential applicants can check the equivalence of their qualification or experience by emailing details to computing.enquiries@napier.ac.uk

Indian applicants should have passed a four-year degree such as BTech. Pakistani applicants should have an MSc in computing. Nigerian applicants should have an honours degree plus at least two years relevant experience.

For students whose first language is not English; a recognised language qualification equivalent to an IELTS score of 6.0. MSc/PG.Dip. Advanced Networking (F/T) Napier University, Edinburgh ©2006, Napier University Page 3 21/12/2006

Course Structure

You can study the course in full-time mode over approximately one and a half years, or in part-time mode over approximately two and a half years.

You may elect to exit from the course with a post-graduate certificate after successful completion of four modules or a post-graduate diploma after successful completion of eight modules.

Full-time Course

The structure for the full-time MSc/PgDip. in Information Systems is shown below. Trimesters 1 and 2 each involve four subjects (modules) being taught in parallel.

Full-time mode (September/October Start)

15 credits

15 credits

15 credits

15 credits

Award

Trimester 1

Routing Technologies

CO74031

Network Programming

CO72053

Network Technologies

CO74034

Wireless LANs

CO72047

Postgraduate Certificate (60 credits)

Trimester 2

Switching Technologies

CO74041

Network & Server Administration

CO74033

Remote Access & Network Applications

CO74032

e-Security

CO73046

Postgraduate Diploma (120 credits)

Trimester 3

CO72008

MSc Dissertation

Masters Degree (180 credits)











Configuring IPv4 for Gigabit Ethernet Interfaces

Cisco MDS 9000 Family supports IP version 4 (IPv4) on Gigabit Ethernet interfaces. This chapter

describes how to configure IPv4 addresses and other IPv4 features.

This chapter includes the following topics:

About IPv4, page 45-1

Basic Gigabit Ethernet Configuration for IPv4, page 45-2

Verifying Gigabit Ethernet Connectivity, page 45-4

VLANs, page 45-5

Configuring Static IPv4 Routing, page 45-7

IPv4-ACLs, page 45-7

ARP Cache, page 45-9

Displaying IPv4 Statistics, page 45-10

Default Settings, page 45-10

About IPv4

Both FCIP and iSCSI rely on TCP/IP for network connectivity. On each IPS module or MPS-14/2

module, connectivity is provided in the form of Gigabit Ethernet interfaces that are appropriately

configured. This section covers the steps required to configure IP for subsequent use by FCIP and iSCSI.

Note For information about configuring FCIP, see Chapter 40, “Configuring FCIP.” For information about

configuring iSCSI, see Chapter 42, “Configuring iSCSI.”

A new port mode, called IPS, is defined for Gigabit Ethernet ports on each IPS module or MPS-14/2

module. IP storage ports are implicitly set to IPS mode, so it can only be used to perform iSCSI and FCIP

storage functions. IP storage ports do not bridge Ethernet frames or route other IP packets.

Each IPS port represents a single virtual Fibre Channel host in the Fibre Channel SAN. All the iSCSI

hosts connected to this IPS port are merged and multiplexed through the single Fibre Channel host.

In large scale iSCSI deployments where the Fibre Channel storage subsystems require explicit LUN

access control for every host device, use of proxy-initiator mode simplifies the configuration.

Note The Gigabit Ethernet interfaces on the MPS-14/2 module do not support EtherChannel.

45-2

Cisco MDS 9000 Family CLI Configuration Guide

OL-8222-08, Cisco MDS SAN-OS Release 3.x

Chapter 45 Configuring IPv4 for Gigabit Ethernet Interfaces

Basic Gigabit Ethernet Configuration for IPv4

Note To configure IPv6 on a Gigabit Ethernet interface, see the Configuring IPv6 Addressing and Enabling

IPv6 Routing” section on page 46-11.

Tip Gigabit Ethernet ports on any IPS module or MPS-14/2 module should not be configured in the same

Ethernet broadcast domain as the management Ethernet port—they should be configured in a different

broadcast domain, either by using separate standalone hubs or switches or by using separate VLANs.

Basic Gigabit Ethernet Configuration for IPv4

Figure 45-1 shows an example of a basic Gigabit Ethernet IP version 4 (IPv4) configuration.

Figure 45-1 Gigabit Ethernet IPv4 Configuration Example

Note The port on the Ethernet switch to which the MDS Gigabit Ethernet interface is connected should be

configured as a host port (also known as access port) instead of a switch port. Spanning tree

configuration for that port (on the Ethernet switch) should disabled. This helps avoid the delay in the

management port coming up due to delay from Ethernet spanning tree processing that the Ethernet

switch would run if enabled. For Cisco Ethernet switches, use either the switchport host command in

IOS is or the set port host in Catalyst OS. Refer to the configuration guide for your Ethernet switch.

To configure the Gigabit Ethernet interface for the example in Figure 45-1, follow these steps:

This section includes the following topics:

Configuring Interface Descriptions, page 45-3

Configuring Beacon Mode, page 45-3

Configuring Autonegotiation, page 45-3

Configuring the MTU Frame Size, page 45-3

10.1.1.100/24

10.1.1.1/24

Switch 1 IP router

10.100.1.1/24

10.100.1.25/24

IP host

91555

Command Purpose

Step 1 switch# config terminal

switch(config)#

Enters configuration mode.

Step 2 switch(config)# interface gigabitethernet 2/2

switch(config-if)#

Enters the interface configuration mode on the

Gigabit Ethernet interface (slot 2, port 2).

Step 3 switch(config-if)# ip address 10.1.1.100

255.255.255.0

Enters the IPv4 address (10.1.1.100) and subnet

mask (255.255.255.0) for the Gigabit Ethernet

interface.

Step 4 switch(config-if)# no shutdown Enables the interface.

45-3

Cisco MDS 9000 Family CLI Configuration Guide

OL-8222-08, Cisco MDS SAN-OS Release 3.x

Chapter 45 Configuring IPv4 for Gigabit Ethernet Interfaces

Basic Gigabit Ethernet Configuration for IPv4

Configuring Promiscuous Mode, page 45-4

Configuring Interface Descriptions

See the “About Interface Descriptions” section on page 12-15 for details on configuring the switch port

description for any interface.

Configuring Beacon Mode

See the “About Beacon Mode” section on page 12-17 for details on configuring the beacon mode for any

interface.

Configuring Autonegotiation

By default, autonegotiation is enabled all Gigabit Ethernet interface. You can enable or disable

autonegotiation for a specified Gigabit Ethernet interface. When autonegotiation is enabled, the port

automatically detects the speed or pause method, and duplex of incoming signals based on the link

partner. You can also detect link up conditions using the autonegotiation feature.

To configure autonegotiation, follow these steps:

Configuring the MTU Frame Size

You can configure the interfaces on a switch to transfer large (or jumbo) frames on a port. The default

IP maximum transmission unit (MTU) frame size is 1500 bytes for all Ethernet ports. By configuring

jumbo frames on a port, the MTU size can be increased up to 9000 bytes.

Note The minimum MTU size is 576 bytes.

Tip MTU changes are disruptive, all FCIP links and iSCSI sessions flap when the software detects a change

in the MTU size.

You do not need to explicitly issue the shutdown and no shutdown commands.

Command Purpose

Step 1 switch# config terminal

switch(config)#

Enters configuration mode.

Step 2 switch(config)# interface gigabitethernet 2/2

switch(config-if)#

Enters the interface configuration mode on the

Gigabit Ethernet interface (slot 2, port 2).

Step 3 switch(config-if)# switchport auto-negotiate Enables autonegotiation for this Gigabit

Ethernet interface (default).

switch(config-if)# no switchport

auto-negotiate

Disables autonegotiation for this Gigabit

Ethernet interface.

45-4

Cisco MDS 9000 Family CLI Configuration Guide

OL-8222-08, Cisco MDS SAN-OS Release 3.x

Chapter 45 Configuring IPv4 for Gigabit Ethernet Interfaces

Verifying Gigabit Ethernet Connectivity

To configure the MTU frame size, follow these steps:

Configuring Promiscuous Mode

You can enable or disable promiscuous mode on a specific Gigabit Ethernet interface. By enabling the

promiscuous mode, the Gigabit Ethernet interface receives all the packets and the software then filters

and discards the packets that are not destined for that Gigabit Ethernet interface.

To configure the promiscuous mode, follow these steps:

Verifying Gigabit Ethernet Connectivity

Once the Gigabit Ethernet interfaces are connected with valid IP addresses, verify the interface

connectivity on each switch. Ping the IP host using the IP address of the host to verify that the static IP

route is configured correctly.

Note If the connection fails, verify the following, and ping the IP host again:

- The IP address for the destination (IP host) is correctly configured.

- The host is active (powered on).

- The IP route is configured correctly.

- The IP host has a route to get to the Gigabit Ethernet interface subnet.

- The Gigabit Ethernet interface is in the up state.

Use the ping command to verify the Gigabit Ethernet connectivity (see Example 45-1). The ping

command sends echo request packets out to a remote device at an IP address that you specify (see the Using the ping and ping ipv6 Commands” section on page 2-15).

Use the show interface gigabitethernet command to verify if the Gigabit Ethernet interface is up.

Command Purpose

Step 1 switch# config terminal

switch(config)#

Enters configuration mode.

Step 2 switch(config)# interface gigabitethernet 2/2

switch(config-if)#

Enters the interface configuration mode on the

Gigabit Ethernet interface (slot 2, port 2).

Step 3 switch(config-if)# switchport mtu 3000 Changes the MTU size to 3000 bytes. The

default is 1500 bytes.

Command Purpose

Step 1 switch# config terminal

switch(config)#

Enters configuration mode.

Step 2 switch(config)# interface gigabitethernet 2/2

switch(config-if)#

Enters the interface configuration mode on the

Gigabit Ethernet interface (slot 2, port 2).

Step 3 switch(config-if)# switchport promiscuous-mode

on

Enables promiscuous mode for this Gigabit

Ethernet interface. The default is off.

switch(config-if)# switchport promiscuous-mode

off

Disables (default) promiscuous mode for this

Gigabit Ethernet interface.

switch(config-if)# no switchport

promiscuous-mode

Disables (default) the promiscuous mode for

this Gigabit Ethernet interface.

Cisco MDS 9000 Family CLI Configuration Guide

OL-8222-08, Cisco MDS SAN-OS Release 3.x

Chapter 45 Configuring IPv4 for Gigabit Ethernet Interfaces

VLANs

Example 45-1 Verifying Gigabit Ethernet Connectivity

switch# ping 10.100.1.25

PING 10.100.1.25 (10.100.1.25): 56 data bytes

64 bytes from 10.100.1.25: icmp_seq=0 ttl=255 time=0.1 ms

64 bytes from 10.100.1.25: icmp_seq=1 ttl=255 time=0.1 ms

64 bytes from 10.100.1.25: icmp_seq=2 ttl=255 time=0.1 ms

--- 10.100.1.25 ping statistics ---

3 packets transmitted, 3 packets received, 0% packet loss

round-trip min/avg/max = 0.1/0.1/0.1 ms

VLANs

This section describes virtual LAN (VLAN) support in Cisco MDS SAN-OS and includes the following

topics:

About VLANs for Gigabit Ethernet, page 45-5

Configuring the VLAN Subinterface, page 45-6

Interface Subnet Requirements, page 45-6

About VLANs for Gigabit Ethernet

Virtual LANs (VLANs) create multiple virtual Layer 2 networks over a physical LAN network. VLANs

provide traffic isolation, security, and broadcast control.

Gigabit Ethernet ports automatically recognize Ethernet frames with IEEE 802.1Q VLAN

encapsulation. If you need to have traffic from multiple VLANs terminated on one Gigabit Ethernet port,

configure subinterfaces—one for each VLAN.

Note If the IPS module or MPS-14/2 module is connected to a Cisco Ethernet switch, and you need to have

traffic from multiple VLANs coming to one IPS port, verify the following requirements on the Ethernet

switch:

- The Ethernet switch port connected to the IPS module or MPS-14/2 module is configured as a trunking

port.

- The encapsulation is set to 802.1Q and not ISL, which is the default.

Use the VLAN ID as a subscription to the Gigabit Ethernet interface name to create the subinterface

name (the /.).

45-6

Cisco MDS 9000 Family CLI Configuration Guide

OL-8222-08, Cisco MDS SAN-OS Release 3.x

Chapter 45 Configuring IPv4 for Gigabit Ethernet Interfaces

VLANs

Configuring the VLAN Subinterface

To configure a VLAN subinterface (VLAN ID), follow these steps:

Interface Subnet Requirements

Gigabit Ethernet interfaces (major), subinterfaces (VLAN ID), and management interfaces (mgmt 0) can

be configured in the same or different subnet depending on the configuration (see Table 45-1).

Note The configuration requirements in Table 45-1 also apply to Ethernet PortChannels.

Command Purpose

Step 1 switch# config terminal

switch(config)#

Enters configuration mode.

Step 2 switch(config)# interface gigabitethernet 2/2.100

switch(config-if)#

Specifies the subinterface on which 802.1Q

is used (slot 2, port 2, VLAN ID 100).

Note The subinterface number, 100 in this

example, is the VLAN ID. The

VLAN ID ranges from 1 to 4093.

Step 3 switch(config-if)# ip address 10.1.1.101

255.255.255.0

Enters the IPv4 address (10.1.1.100) and

subnet mask (255.255.255.0) for the Gigabit

Ethernet interface.

Step 4 switch(config-if)# no shutdown Enables the interface.

Table 45-1 Subnet Requirements for Interfaces

Interface 1 Interface 2

Same Subnet

Allowed Notes

Gigabit Ethernet 1/1 Gigabit Ethernet 1/2 Yes Two major interfaces can be configured in the same

or different subnets.

Gigabit Ethernet 1/1.100 Gigabit Ethernet 1/2.100 Yes Two subinterfaces with the same VLAN ID can be

configured in the same or different subnets.

Gigabit Ethernet 1/1.100 Gigabit Ethernet 1/2.200 No Two subinterfaces with different VLAN IDs cannot

be configured in the same subnet.

Gigabit Ethernet 1/1 Gigabit Ethernet 1/1.100 No A subinterface cannot be configured on the same

subnet as the major interface.

mgmt0 Gigabit Ethernet 1/1.100 No The mgmt0 interface cannot be configured in the

same subnet as the Gigabit Ethernet interfaces or

subinterfaces.

mgmt0 Gigabit Ethernet 1/1 No

Cisco MDS 9000 Family CLI Configuration Guide

OL-8222-08, Cisco MDS SAN-OS Release 3.x

Chapter 45 Configuring IPv4 for Gigabit Ethernet Interfaces

Configuring Static IPv4 Routing

Configuring Static IPv4 Routing

To configure static IPv4 routing (see Figure 45-1) through the Gigabit Ethernet interface, follow these

steps:

Displaying the IPv4 Route Table

The ip route interface command takes the Gigabit Ethernet interface as a parameter and returns the

route table for the interface. See Example 45-2.

Example 45-2 Displays the IP Route Table

switch# show ips ip route interface gig 8/1

Codes: C - connected, S - static

No default gateway

C 10.1.3.0/24 is directly connected, GigabitEthernet8/1

Connected (C) identifies the subnet in which the interface is configured (directly connected to the

interface). Static (S) identifies the static routes that go through the router.

IPv4-ACLs

This section describes the guidelines for IPv4 access control lists (IPv4-ACLs) and how to apply them

to Gigabit Ethernet interfaces.

This section includes the following topics:

Gigabit Ethernet IPv4-ACL Guidelines, page 45-8

Applying IPv4-ACLs on Gigabit Ethernet Interfaces, page 45-8

Note For information on creating IPv4-ACLs, see Chapter 34, “Configuring IPv4 and IPv6 Access Control

Lists.”

Command Purpose

Step 1 switch# config terminal

switch(config)#

Enters configuration mode.

Step 2 switch(config)# ip route

10.100.1.0 255.255.255.0 10.1.1.1

switch(config-if)#

Enters the IP subnet (10.100.1.0 255.255.255.0) of the IP host

and configures the next hop 10.1.1.1, which is the IPv4

address of the router connected to the Gigabit Ethernet

interface.

Cisco MDS 9000 Family CLI Configuration Guide

OL-8222-08, Cisco MDS SAN-OS Release 3.x

Chapter 45 Configuring IPv4 for Gigabit Ethernet Interfaces

IPv4-ACLs

Gigabit Ethernet IPv4-ACL Guidelines

Follow these guidelines when configuring IPv4-ACLs for Gigabit Ethernet interfaces:

Only use Transmission Control Protocol (TCP) or Internet Control Message Protocol (ICMP).

Note Other protocols such as User Datagram Protocol (UDP) and HTTP are not supported in

Gigabit Ethernet interfaces. Applying an ACL that contains rules for these protocols to a

Gigabit Ethernet interface is allowed but those rules have no effect.

Apply IPv4-ACLs to the interface before you enable an interface. This ensures that the filters are in

place before traffic starts flowing.

Be aware of the following conditions:

If you use the log-deny option, a maximum of 50 messages are logged per second.

The established option is ignored when you apply IPv4-ACLs containing this option to Gigabit

Ethernet interfaces.

If an IPv4-ACL rule applies to a pre-existing TCP connection, that rule is ignored. For example

if there is an existing TCP connection between A and B and an IPv4-ACL which specifies

dropping all packets whose source is A and destination is B is subsequently applied, it will have

no effect.

Tip If IPv4-ACLs are already configured in a Gigabit Ethernet interface, you cannot add this interface to an

Ethernet PortChannel group. Chapter 34, “Configuring IPv4 and IPv6 Access Control Lists,” for

information on configuring IPv4-ACLs.

Applying IPv4-ACLs on Gigabit Ethernet Interfaces

To apply an IPv4-ACL on a Gigabit Ethernet interface, follow these steps:

Command Purpose

Step 1 switch# config t Enters configuration mode.

Step 2 switch(config)# interface gigabitethernet 3/1

switch(config-if)#

Configures a Gigabit Ethernet interface

(3/1).

Step 3 switch(config-if)# ip access-group SampleName Applies the IPv4-ACL SampleName on

Gigabit Ethernet 3/1 for both ingress and

egress traffic (if the association does not

exist already).

Step 4 switch(config-if)# ip access-group SampleName1 in Applies the IPv4-ACL SampleName on

Gigabit Ethernet 3/1 for ingress traffic.

switch(config-if)# ip access-group SampleName2 out Applies the IPv4-ACL SampleName on

Gigabit Ethernet 3/1 for egress traffic (if

the association does not exist already).

Cisco MDS 9000 Family CLI Configuration Guide

OL-8222-08, Cisco MDS SAN-OS Release 3.x

Chapter 45 Configuring IPv4 for Gigabit Ethernet Interfaces

ARP Cache

ARP Cache

Cisco MDS SAN-OS supports ARP cache for Gigabit Ethernet interface configured for IPv4. This

section includes the following topics:

Displaying ARP Cache, page 45-9

Clearing ARP Cache, page 45-9

Displaying ARP Cache

You can display the ARP cache on Gigabit Ethernet interfaces.

Note Use the physical interface, not the subinterface, for all ARP cache commands.

Use the show ips arp interface gigabitethernet command to display the ARP cache on the Gigabit

Ethernet interfaces. This command takes the Ethernet interface as a parameter and returns the ARP cache

for that interface. See Example 45-3.

Example 45-3 Displays ARP Caches

switch# show ips arp interface gigabitethernet 7/1

Protocol Address Age (min) Hardware Addr Type Interface

Internet 20.1.1.5 3 0005.3000.9db6 ARPA GigabitEthernet7/1

Internet 20.1.1.10 7 0004.76eb.2ff5 ARPA GigabitEthernet7/1

Internet 20.1.1.11 16 0003.47ad.21c4 ARPA GigabitEthernet7/1

Internet 20.1.1.12 6 0003.4723.c4a6 ARPA GigabitEthernet7/1

Internet 20.1.1.13 13 0004.76f0.ef81 ARPA GigabitEthernet7/1

Internet 20.1.1.14 0 0004.76e0.2f68 ARPA GigabitEthernet7/1

Internet 20.1.1.15 6 0003.47b2.494b ARPA GigabitEthernet7/1

Internet 20.1.1.17 2 0003.479a.b7a3 ARPA GigabitEthernet7/1

Clearing ARP Cache

The ARP cache can be cleared in two ways: clearing just one entry or clearing all entries in the ARP

cache.

Use the clear ips arp command to clear the ARP cache. See Example 45-4 and Example 45-5.

Example 45-4 Clearing One ARP Cache Entry

switch# clear ips arp address 10.2.2.2 interface gigabitethernet 8/7

arp clear successful

Example 45-5 Clearing All ARP Cache Entries

switch# clear ips arp interface gigabitethernet 8/7

arp clear successful

Cisco MDS 9000 Family CLI Configuration Guide

OL-8222-08, Cisco MDS SAN-OS Release 3.x

Chapter 45 Configuring IPv4 for Gigabit Ethernet Interfaces

Displaying IPv4 Statistics

Displaying IPv4 Statistics

Use the show ips stats ip interface gigabitethernet to display and verify IP v4 statistics. This command

takes the main Ethernet interface as a parameter and returns the IPv4 statistics for that interface. See

Example 45-6.

Note Use the physical interface, not the subinterface, to displayIPv4 statistics.

Example 45-6 Displays IPv4 Statistics

switch# show ips stats ip interface gigabitethernet 4/1

Internet Protocol Statistics for port GigabitEthernet4/1

168 total received, 168 good, 0 error

0 reassembly required, 0 reassembled ok, 0 dropped after timeout

371 packets sent, 0 outgoing dropped, 0 dropped no route

0 fragments created, 0 cannot fragment

Default Settings

Table 45-2 lists the default settings for IPv4 parameters.

Table 45-2 Default IPv4 Parameters

Parameters Default

IPv4 MTU frame size 1500 bytes for all Ethernet ports.

Autonegotiation Enabled.

Promiscuous mode Disabled.

IPv4 vs. IPv6

IP Version 4

32-Bit Adressing

(2^32 Adresses = 4.294.967.296)

studies say that there will not be

enough adresses anymore in 2010 (just

think of china, india and the upcoming

mobile IP generation)

IP v4 Problems

IP adress starvation

Distribution of adresses (USA >50%)

Routing is complicated

Realization of new technologies

(Mobile computing, real time services,

multicast, security, QOS, etc.)

IP version 6 (since 1996)

128-bit adresses

(2^128 Adresses = 3.4*10^38)

smaller header

options placed in extension headers

mobile IPv6 – roaming networks

comparison of headers (cont´d)

IP v4: - every header has ALL options

- inspected by each router

-> TIME ISSUE !

IP v6: - options in extension headers

- next header pointers

- routers don´t have to check

options (except hop-by-hop)

IP version 6: extension header

Hop-by-hop options header

Destinations options header

Routing header

Fragment header

Authentication header

Encapsulation security payload header

IP version 6: adress format

Hexadecimal:

3ffe : 0400 : 0060 : 004d : 0250 : 04ff : fe44 : b099

Without leading zeros:

3ffe : 400 : 60 : 4d : 250 : 4ff : fe44 : b099

Shortened adress format:

3ffe : 0 : 0 : 4d : 250 : 4ff : fe44 : b099

3ffe : : 4d : 250 : 4ff : fe44 : b099

Prefix:

3ffe : 400 : 60 : 4d : 250 : 4ff : fe44 : b099 /64

IP v4 vs. V6: migration / compatibility

Computers migrated to IPv6 can still be

reached over IPv4 (Dual stack)

IPv6 can be tunneled over IPv4s

networks

There will have to be a long-time

compatibility“