Pengalokasian Bandwith Secara Otomatis Menggunakan Metode Per Connection Queue.

Abstract

This research paper results in a technique used existing method for dividing the bandwidth automatically by using
Per Connection Queue (PCQ) method to keep it optimal and evade individual control among the users, load limitation
in using the available bandwidth, and excessive bandwidth capacity. The allocation of bandwidth is divided
evenly and based on all users’ needs and can reduce the company’s cost of bandwidth investment. In this research,
used case study at PT. Asuransi Jasindo Pontianak and using NDLC (Network Development Life Cycle) to optimize
the bandwidth allocation by applying top down approach model. The result of this research shows that all users
can stably access the internet with the same data transfer rate; thus, they can optimally utilize the bandwidth
capacity owned by the company and evade bandwidth leakage. The test also shows that the configuration of bandwidth
limiter using Queue Tree method is very well done, whereby the scores between upload and download needs
do not have the significant difference.
Keywords: Optimization of Bandwidth, Per Connection Queue Method, Top-Down Approach

1. Pendahuluan
Pemakaian jasa internet setiap pengguna menginginkan kecepatan akses internet yang maksimal. Kecepatan
akses internet tentunya akan berhubungan dengan besarnya kapasitas bandwidth yang tersedia dalam suatu
jaringan. Untuk mendapatkan kecepatan akses yang maksimal dan dengan resource bandwidth yang terbatas, maka
bandwidth memerlukan pengaturan yang baik untuk menjaga lalu lintas data dalam suatu jaringan komputer agar
tidak terjadi kemacetan sebagai akibat dari adanya permintaan akses yang overload dalam jaringan. Dewasa ini
kebutuhan akses internet dalam perusahaan PT. Asuransi Jasindo sangat tinggi dan seringkali pemanfaatannya
kurang optimal sehingga mengganggu aktivitas dan kinerja karyawan dalam bekerja. Persoalan yang sering terjadi
antar pengguna adalah tidak adanya pembatasan pemakaian kapasitas bandwidth sehingga yang terjadi adalah
perbedaan kecepatan antara pengguna yang satu dengan pengguna yang lain. Kenyataan ini jelas memberikan
pengaruh yang sangat signifikan untuk kelancaran penyelesaian pekerjaan dan layanan untuk proses bisnis
aktivitas perusahaan.
Membagi kapasitas bandwidth dengan PCQ (Per Connection Queue) prinsipnya menggunakan metode
antrian untuk menyamakan bandwidth yang dipakai pada multiple client. Metode PCQ yang diterapkan
menggunakan metode NDLC (Network Development Life Cycle) dengan pendekatan Top-Down. Sementara
teknologi yang digunakan untuk mengimplementasikanya didasarkan pada pendekatan yang disebut QoS (Quality
of Service). Secara default QoS ini berada dalam perangkat mikrotik untuk mengatur traffic jaringan dan lalu lintas
data/informasi (Herlambang, 2008). Mikrotik dapat dijalankan pada sebuah PC (Personal Computer) biasa atau
pada sistem mini routerboard yang bisa berfungsi sebagai router, bridge, hotspot gateway, firewall, bandwidth
limiter, dan lain-lain. Mikrotik merupakan sistem operasi linux-based yang dirancang secara khusus untuk
keperluan networking (Harijanto, 2008). Fasilitas router dalam mikrotik mempunyai peran penting untuk
menghubungkan client ke jaringan Internet melalui Network Address Translation (Kustanto, 2008). Cara kerja
QoS adalah dengan cara mengidentifikasi lalu lintas data yang melalui jaringan, kemudian menerapkan kebijakan
QoS yang digunakan untuk melindungi, memprioritaskan atau untuk memberikan batasan (Santoso, 2007).
Melalui teknik ini keseluruhan kapasitas bandwidth yang tersedia dapat digunakan secara optimal tanpa ada
sumberdaya yang terbuang percuma.
Metode PCQ merupakan metode dengan antrian membagi kapasitas bandwith sehingga dapat melakukan
pembatasan. Dalam PCQ juga menciptakan subqueues, mengenai parameter pcqclassifier. Subqueue masingmasing
memiliki data rate batas pcq-rate dan ukuran pcq-limit paket. Ukuran total antrian PCQ tidak dapat lebih
besar dari pcq-total-limit paket. Metode PCQ ini dilengkapi dengan penerapan Queue Tree, agar kapasitas
bandwidth dapat dibagi secara otomatis oleh sistem dengan batasan limit bandwidth sehingga jika terdapat satu
client bisa mencapai keseluruhan kapasitas bandwidth yang ada (Ni, 2007).
208
ISBN 978-602-70361-0-9

2. Metode
Berdasarkan dari hasil tinjauan pustaka dari sejumlah literatur, wawancara dan obeservasi yang sesuai
dengan kenyataan dan permasalahan yang di hadapi dari objek penelitian yang berupa studi kasus, demi memahami
strategi penelitian dalam konteks tunggal agar mengacu kepada objek penelitian yaitu pengalokasian kapasitas
bandwith secara otomatis dengan metode Per Connection Queue (PCQ). Pengembangan sistem jaringan yang
dilakukan mengacu kepada model Network Development Life Cycle (NDLC), yaitu suatu pendekatan proses
dalam komunikasi data yang menggambarkan siklus yang tiada awal dan akhirnya dalam membangun sebuah
jaringan komputer. Adapun sistem jaringan yang akan dikembangkan disesuaikan dengan pendekatan Top Down,
yaitu suatu pendekatan yang meliputi strategi dalam pemrosesan informasi dimana NDLC merupakan salah satu
aspek pendukung didalamnya. Responden dalam penelitian ini berjumlah 30 dengan teknik accidental sampling.
3. Hasil dan Pembahasan
Sistem pengalokasian kapasitas bandwith secara otomatis dengan metode PCQ pada perusahaan PT.
Asuransi Jasindo menggunakan arsitektur switched Ethernet untuk menghubungkan setiap komputer yang ada
dalam perusahaan tersebut. Sistem jaringan didukung oleh penggunaan mikrotik router dan perangkat fireboxwatchguard
sebagai firewall (Intrusion Detection System) jaringan dan setiap PC dilengkapi NIC 10/100/1000
untuk memungkinkan peningkatan kecepatan yang mudah ke jaringan Gigabit Ethernet generasi berikutnya.
Selanjutnya melakukan analisa jaringan agar koordinasi dan pengurutan kegiatan-kegiatan pabrik/proyek yang
kompleks, dapat saling berhubungan dan saling bergantung satu sama lain. Analisis jaringan juga bertujuan agar
perencanaan dan pengawasan semua kegiatan dapat dilakukan secara sistematis sehingga dapat diperoleh efisiensi
kerja. Berikut ini adalah uraian dari perangkat dan kebutuhan sevice lainnya yang digunakan untuk mendukung
pengembangan jaringan adalah berupa media transmisi menggunakan kabel UTP (Unshielded Twisted Pair)
kategori 5, untuk switch berupa router WAG120N (switch layer 3), mikrotik, Router RB750, dan ISP
menggunakan Telkom Net Speedy. Adapun aplikasi yang digunakan daam penelitian ini adalah sistem operasi
menggunakan Windows 2003 Server, Router menggunakan MikrotikOS, client menggunakan OS Windows 7,
Database menggunakan microsoft acces 2010, Microsoft SQL Server 2008, MySQL 5 Community Edition.
Sementara untuk network menggunakan wireshark, multi router traffic grapher, Squid Analysis Report Generator.
Gambar 1. Koneksi Jaringan Komputer
Memiliki 12 komputer yang dalam pengoperasiannya saling berbagi data dan 1 unit komputer difungsikan
sebagai pusat data atau server. Supaya keinginan untuk mengkoneksikan ke 12 unit komputer termasuk server
maka setiap komputer perlu berada pada satu subnet yang sama (lihat gambar 1). Implementasi jaringan dan
pengujian kapasitas bandwidth melalui mikrotik dengan metode PCQ (Per Connection Queue) prinsipnya
menggunakan metode antrian/Queue untuk menyeimbangkan kapasitas bandwidth yang dipakai pada multiple
client. Saat memiliki kapsitas bandwidth internet sebesar 2 Mbps, dan perlu membagi kapasitas bandwidth
menjadi 12 PC, maka ketika semua PC tersebut terpakai, maka akan mendapatkan kapasitas bandwidth sebesar
2Mbps/12 = sekitar 200kbps, tetapi pada saat komputer yang terpakai hanya 5 buah, maka masing-masing PC
secara otomatis akan mendapatkan bandwidth sebesar 2Mbps/5 = 400kbps sehingga keseluruhan bandwidth bisa
terpakai secara optimal. Berikut ini adalah pengujian kegiatan pengimplementasian jaringan internet dengan
menerapkan metode Queue Tree. Kondisi ini diawali dengan memberikan IP Address pada komputer admin yang
209
ISBN 978-602-70361-0-9

digunakan untuk mengkonfigurasi Mikrotik tersebut seperti pada Gambar 2. Selanjutnya untuk masuk ke peralatan
mikrotik user harus melakukan login lebih dahulu, seperti pada Gambar 3.
Gambar 2. Konfigurasi IP Address
Gambar 3. Login User Mikrotik
Langkah berikutnya melakukan konfigurasi interface. Pada bagian interface ini, ada 4 (empat) port yang
dapat digunakan yaitu ether2, ether3, ether4 dan ether5. Dalam penelitian ini menggunakan port ether2 yang
terhubung ke jaringan internet dan ether4 yang terhubung ke switch. Berikut ini adalah gambar interface dari
mikrotik. Pemberian nama interface diperlukan untuk mempermudah dalam mengenal port yang akan digunakan.
Port ether2 diberikan nama “internet” dan port ether5 diberikan nama “local”. Port ether2 diganti dengan nama
local yang mengacu kepada nama port untuk mengkoneksikan komputer local seperti pada 

Gambar 4. Konfigurasi Interface Local Mikrotik

Kemudian untuk port ether5 diganti dengan nama internet yang mengacu kepada nama port untuk
mengkoneksikan komputer local dengan internet. Pemberian IP Address Interface Internet adalah 192.168.2.4/24.
mikrotik akan mendapatkan IP Address secara otomatis dari modem dengan cara mengaktifkan DHCP Client
seperti pada Gambar 5.
210
ISBN 978-602-70361-0-9

Gambar 5. Koneksi Interface Internet

Untuk pemberian IP Address Interface Local yang digunakan adalah 192.168.40.1/24. IP Address ini akan
menjadi gateway bagi semua komputer yang terhubung ke internet. Langkah selanjutnya adalah pemberian IP
Address Interface Internet, IP Address yang akan dijadikan sebagai jalur untuk pengaksesan internet oleh semua
komputer yang terhubung pada jaringan. Mikrotik akan mendapatkan IP Address secara otomatis dari modem
dengan cara mengaktifkan DHCP Client. Berikutnya melakukan konfigurasi pemberian DNS Server IP Address
DNS Server dengan IP Address yang dimiliki oleh modem yaitu 192.168.2.1 seperti pada 

Gambar 6. Pemberian DNS Server

Untuk menghubungkan menghubungkan lebih dari satu komputer ke jaringan internet dengan
menggunakan satu alamat IP perlu melakukan konfigurasi Network Address Translation (NAT). Banyaknya
penggunaan metode ini disebabkan karena ketersediaan alamat IP yang terbatas, kebutuhan akan keamanan, dan
kemudahan serta fleksibilitas dalam administrasi jaringan, seperti pada Gambar 7.
Gambar 7. Network Address Translation
211
ISBN 978-602-70361-0-9

Setelah melakukan konfigurasi NAT maka selanjutnya akan di lakukan konfigurasi mikrotik sebagai
bandwith limiter mikrotik juga dapat digunakan untuk bandwidth limiter (queue) yaitu yang akan melakukan
kontrol terhadap mekanisme alokasi data rate melalui proses mangle. Mangle Mikrotik disini berfungsi sebagai
pembelah IP traffic dan memberi tanda (Mark) pada suatu IP traffic yang nanti akan di proses selanjutanya sesuai
kebutuhan jaringan seperti pada Gambar 8. Mangle memiliki komponen chain dan action. Komponen chain
melakukan proses prerouting ini akan menyaring proses traffic dari sisi LAN ke Internet (Upload), jadi untuk
semua proses dari LAN mengambil Chain Prerouting. Selanjutnya proses postrouting atau forward ini akan
memproses semua traffic dari arah Internet ke LAN (Download), jadi untuk semua proses dari Internet mengambil
Chain Postrouting. Sementara komponen action melakukan proses berupa Mark-connection. Proses ini akan
menandai suatu traffic koneksi yang telah berlangsung yang sudah diketahui servicenya jadi suatu traffic yang
sudah di pisah ini biar tidak bercampur dengan traffic koneksi yang lainnya. Lalu melakukan proses Mark-packet.
Proses ini akan menandai suatu traffic dengan nama paket yang akan diproses ke queue atau bandwith limiter. Jadi
untuk sebuah pengelolaan kapasitas bandwith disini harus mengenal terlebih dahulu traffic-traffic apa saja yang
perlu dipisahkan dan kemudian baru membagi kapasitas bandwithnya.

Gambar 8. Bandwidth Limiter

Hasil dari konfigurasi mangle untuk Connection Mark dan Packet Mark untuk satu buah komputer.
Mengingat pengaturan bandwidth tidak bergantung pada banyaknya komputer maka Connection Mark dan Packet
Mark tidak perlu dibuat sebanyak 12 kali, seperti pada Gambar 9.
Gambar 9. Pembuatan Queue Type
Setelah proses pembuatan queue type selesai, maka akan tampil dua buah nama queue type pada queue list.
Pembuatan queue berikut ini akan menentukan parent local dan parent internet. Artinya downstream mengacu
kepada parent local dan upstream mengacu kepada internet. Setelah pembuatan queue selesai maka selanjutnya
membuat parent, seperti pada Gambar 10.
212
ISBN 978-602-70361-0-9

Gambar 10. Pembuatan Parent

Teknik pembagian bandwidth dengan metode PCQ adalah membagi secara merata total bandwidth kepada
semua pengguna. Jika total bandwidth 512 kbps dan pemakainya hanya satu komputer maka total bandwidth yang
didapat pengguna tersebut adalah 512 kbps. Apabila pengguna sebanyak 2 orang maka total bandwidth per orang
adalah sebesar 256 kbps. Sesudah selesai dengan implementasi maka akan melakukan pengujian dari hasil dari
konfigurasi. Untuk menguji kinerja dari router mikrotik yang telah dikonfigurasi sebagai manajemen bandwidth
dengan metode PCQ dan menggunakan sistem antrian queue tree. Ada beberapa kemungkinan yang terjadi dalam
jaringan dimana beberapa client mungkin saja melakukan aktivitas yang sama yaitu download atau upload serta
mungkin juga melakukan aktivitas yang berbeda dimana beberapa client melakukan aktivitas upload sedangkan
client yang lain melakukan download. Pengujian kecepatan akses internet atau yang sering disebut dengan test
speed adalah sebuah kegiatan untuk melakukan pengecekan terhadap kecepatan akses internet yang telah
disediakan oleh ISP (Internet Service Provider). Pengujian ini juga bertujuan untuk memastikan apakah kecepatan
akses internet yang disediakan sama dengan jumlah yang harus dibayar. Di dalam internet adalah istilah CIR
(Committed Information Rate) yang berarti kecepatan minimal yang harus dipenuhi oleh ISP dalam layanannya
harus sesuai dengan kontrak antara perusahaan yang menggunakan internet dengan perusahaan penyedia layanan
internet (ISP).
Dalam pengujian ini menggunakan http://speedtest.cbn.net.id dan http://10.speedtest.telkomspeedy.com.
Pada pengujian dengan menggunakan http://speedtest.cbn.net.id/, dapat dilihat bahwa download speed sebesar 251
kbps dari 256 kbps yang dialokasikan. Sedangkan Upload Speed sebesar 117 kbps dari 128 kbps yang dialokasi.
Walaupun ada selisih angka antara hasil dan dengan yang dilalokasikan, namun angkat tidak terlalu tinggi. Ini
membuktikan konfigurasi bandwidth limiter dengan metode Queue Tree sudah sangat baik. Pengujian dengan
menggunakan http://10.speedtest.telkomspeedy.com/, dapat dilihat bahwa download speed sebesar 246 kbps dari
256 kbps yang dialokasikan. Sedangkan Upload Speed sebesar 102 kbps dari 128 kbps yang dialokasi. Walaupun
ada selisih angka antara hasil dan dengan yang dilalokasikan, namun angkat tidak terlalu tinggi. Ini membuktikan
bahwa konfigurasi bandwidth limiter dengan metode Queue Tree sudah sangat baik. Dari gambar tersebut
khusunya pada transfer rate, diperlihatkan bahwa kecepatan download adalah 246 kbps dengan transfer rate 30.8
KB/sec. Artinya apabila komputer dengan IP address 192.168.40.4 melakukan download program, maka rata-rata
transfer per detik adalah 30.8 KB. Melakukan pengujian terhadap download adalah sebuah kegiatan yang bertujuan
untuk memastikan apakah hasil konfigurasi pengaturan bandwidth dan test speed sesuai dengan kenyataan. Berikut
ini pengujian dengan cara melakukan download sebuah program. Untuk data pengujiannya menggunakan program
Mikrotik Winbox yaitu all_packages-x86-6.2.zip dengan ukuran file 16,140 MB. Hasilnya memperlihatkan
transfer rate adalah 30,209 KB/sec. Angkat ini memberikan gambaran bahwa file all_packages-x86-6.2.zip dengan
ukuran 16,140 MB di download dengan kecepatan rata-ratanya adalah 30.209 KB/sec. Ini berarti bahwa hasil test
speed seperti yang telah dijelaskan sebelumnya adalah sesuai walaupun ada selisih sedikit dari angka yang ada di
test speed dengan angkat pada saat download.


4. Kesimpulan
Pembagian kapasitas bandwidth dilakukan dengan metode PCQ dilakukan secara merata ke semua
pengguna yang menggunakan format IP Address 192.168.40.0/24. Agar kestabilan dan kecepatan transfer data
sama dan tidak terjadi tarik menarik bandwidth antar pengguna, dan pengalokasian kapasitas bandwidth dapat
menjadi lebih optimal berdasarkan ukuran data dan kapasitas yang ada.


Daftar Pustaka
Arifin, Yunus. Implementasi Quality of Service Dengan Metode HTB (Hierarchical Token Bucket) Pada PT.
Komunika Lima Duabelas. JELIKU Vol 1 No.2 Nopember 2012. Hal 1-7.
213
ISBN 978-602-70361-0-9

Tutorial Lengkap Membuat Aplikasi Parkir Kendaraan Menggunakan Java Netbeans Dan MySQL

Tutorial Lengkap Membuat Aplikasi Parkir Kendaraan Menggunakan Java Netbeans Dan MySQL - Halo sobat , kali ini ane mau ngasih tutorial tentang bagaimana cara bikin aplikasi parkir kendaraan di netbeans dengan menggunakan database mysql,. Tutorial ini saya buat  segampang mungkin, semoga aja ga ribet buat sobat :D
Ok kita langsung ke tutorial nya, disini saya akan bagi menjadi 4 kategori
1. Membuat database di Mysql
2. Membuat Koneksi dari netbeans ke mysql
3. Membuat form login pada Netbeans
4. Membuat form menu pada netbeans

Kategori 1 Membuat Database di mysql
1. Pastikan Xampp sudah terinstal dengan benar di Pc sobat
2. Buka CMD (Start - run) lalu ketik CMD
3. Ketik cd\
4. cd xampp/mysql/bin
5. mysql –u root
6. create database datalogin; <<< sebagai contoh saya membuat database dengan nama “datalogin”
7. use datalogin; << Memilih database yang akan kita gunakan
8. create table login (Username varchar(15)not null, Password varchar(30) not null , primary key (Username)); <<Membuat table di database datalogin dengan kolom Username max 15 karakter dan Password max 30 karakter dengan kata kunci “Username” 
9. insert into login values(‘Indra Ahmad Iskandar’, ‘admin’); << Mengisi kolom Username =Indra Ahmad Iskandar , Password=admin
10. create table parkirmasuk (notiket varchar(100)not null, tanggalmasuk varchar(30) not null , noplat varchar(10) not null, jeniskendaraan varchar (10) not null, jammasuk varchar (10) not null, primary key (notiket));
Kategori 2 Membuat Koneksi dari Netbeans ke Mysql
1. Buka Netbeans
2. Lalu pilih File-new project 

3. Klik kanan di project ParkirKendaraan pilih New-Java Package

4. Klik kanan di Package Koneksi kemudian pilih New-java class

5. setelah selesai membuat class koneksi, Ketikan kode ini dibawah kode package Koneksi;
import com.mysql.jdbc.Driver;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import javax.swing.JOptionPane;
9. Kemudian ketikan lagi seperti berikut setelah kode di atas
public class KoneksiDB {
    public static Connection koneksi;
    public static Connection getConnection() throws SQLException {
        if(koneksi==null){
            new Driver();
            koneksi =DriverManager.getConnection("jdbc:mysql://localhost:3306/datalogin","root","");
        }
        return koneksi;
    }
    public static void main(String[] args){
        try{
            getConnection();
 JOptionPane.showMessageDialog(null,"koneksi berhasil","report koneksi",JOptionPane.INFORMATION_MESSAGE);
        }
        catch (SQLException ex){
            System.err.println("Koneksi GAGAL");
        }
    }
}


6. Klik kanan di Libraries-Add Library-Mysql JDBC Driver


7. Membuat Koneksi dari Netbeans ke Mysql telah selesai, kemudian klik kanan di KoneksiDB-Run File. Jika koneksi netbeans dan mysql sudah terhubung akan keluar pop up “koneksi berhasil” seperti ini


Kategori 3 Membuat form login pada netbeans
1. Klik kanan pada source package-New-java Packages
2. Isi seperti dibawah ini dan finish


3. Klik kanan pada package Aplikasi yang sudah kita buat tadi pilih New-JFrame Form, da isi seperti Gambar dibawah ini



4. Desain Form seperti ini


5. Ketik kode dibawah ini setelah kode package Aplikasi;
        import javax.swing.*;
        import java.sql.*;
        import javax.swing.table.*;
        import java.awt.Dimension;
        import java.awt.Toolkit;
6. Ketik kode dibawah ini setelah kode diatas
public class FormLogin extends javax.swing.JFrame {
    /**
     * Creates new form FormLogin
     */
    Connection koneksi;
    public FormLogin() {
        initComponents();
    }
    
public void konekdatabase(){
try{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
koneksi=DriverManager.getConnection("jdbc:mysql://localhost:3306/datalogin","root","");
}
catch (Exception e)
{
System.err.println("Exception: "+e.getMessage());
}
}
public void Login(){
    try
{
    String hasil ="0";
    String sql = "Select count(*) as jml from login where username = '"+username.getText().trim()+"'"+"and password = '"+password.getText().trim()+"'";
    stat = koneksi.createStatement();
    set = stat.executeQuery(sql);
    set.next();
    hasil = set.getString("jml");
    if (Integer.valueOf(hasil)>0){
        JOptionPane.showMessageDialog(null,"Anda Berhasil Login!!!","Peringatan",JOptionPane.WARNING_MESSAGE);
    new FormMenu().setVisible(true);
    dispose();
    }
    else{
        JOptionPane.showMessageDialog(null,"Anda Gagal Login!!!","Peringatan",JOptionPane.WARNING_MESSAGE);
               username.requestFocusInWindow();
               username.setText("");
               password.setText("");
    }
}
   catch (Exception e){
        System.out.println("kesalahan :"+e.toString());
    }
}



7. Sekarang kita akan membuat fungsi di tombol exit, caranya klik Kanan di tombol Exit pilih Event - Action - ActionPerformed seperti gambar dibawah ini


8. Ketik kode 
if(JOptionPane.showConfirmDialog(null,"Apakah Anda yakin akan keluar?","Keluar",JOptionPane.YES_NO_OPTION)== JOptionPane.YES_OPTION){
        System.exit(0);
}

 9. Kembali ke Form Desain, kemudian klik kanan pada tombol Login pilih Event - Action - ActionPerformed (sama seperti membuat tombol Exit) lalu ketik kode dibawah ini (hanya yang saya blok yg ditulis
private void loginActionPerformed(java.awt.event.ActionEvent evt) {                                  
        // TODO add your handling code here:
 konekdatabase();Login(); 
}

10. Ok form login telah selesai.


Kategori 4 Membuat FormKendaraanMasuk pada netbeans

1. Klik kanan pada package Aplikasi pilih New - JFrame Form


2. Kemudian isi seperti dibawah ini dan klik finish


3. Setelah Form terbuat, desain form seperti ini


4. Selanjutnya pindah ke source, dan isi kode berikut dibawah kode package Aplikasi;
import javax.swing.*;
import java.sql.*;
import javax.swing.table.*;
import java.util.Date;
import java.text.SimpleDateFormat;
import java.awt.Dimension;
import java.awt.Toolkit;
5. Ketik kode ini di bawah kode diatas
public class FormKendaraanMasuk extends javax.swing.JFrame {
String no;
String tglmasuk;
String plat_no;
String jns;
String jmmasuk;
DefaultTableModel tabMode;
Connection koneksi;
public FormKendaraanMasuk() {
        initComponents();
        Object[] row= {"No.Tiket","Tgl Masuk", "No Plat", "J.Kendaraan", "Jam Masuk"};
        tabMode=new DefaultTableModel(null,row);
        tabeldata.setModel(tabMode);
        tglskrg();
   
    }
public void tglskrg(){
Date skrg= new Date();
SimpleDateFormat format= new SimpleDateFormat("dd-MM-yyyy");
String tgl = format.format(skrg);
tftanggal.setText(format.format(skrg));
}
    public void konekdatabase(){
try{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
koneksi =DriverManager.getConnection("jdbc:mysql://localhost:3306/datalogin","root","");
}
catch (Exception e)
{
System.err.println("Exception: "+e.getMessage());
}
}
    public void hapustabel(){
int row=tabMode.getRowCount();
for(int i=0;i<row;i++){
tabMode.removeRow(0);
}
}
    public void tampildataketabel(){
hapustabel();
try{
String sql="Select * from parkirmasuk";
Statement stat=koneksi.createStatement();
ResultSet set=stat.executeQuery(sql);
while (set.next()){
no=set.getString("notiket");
tglmasuk=set.getString("tanggalmasuk");
plat_no=set.getString("noplat");
jns=set.getString("jeniskendaraan");
jmmasuk=set.getString("jammasuk");
String[] data={no,tglmasuk,plat_no,jns,jmmasuk};
tabMode.addRow(data);
}
}
catch(Exception e){
}
}
public void clear(){
noTiket.setText("");
platNomor.setText("");
jamMasuk.setText("");
}
    public void simpandata(){
no=noTiket.getText();
tglmasuk=tftanggal.getText();
plat_no=platNomor.getText();
jns=(String)jenis.getSelectedItem();
jmmasuk=jamMasuk.getText();
try{
konekdatabase();
Statement statement=koneksi.createStatement();
String sql="insert into parkirmasuk values ('"+no+"','"+tglmasuk+"','"+plat_no+
"','"+jns+"','"+jmmasuk+"');";
statement.executeUpdate(sql);
statement.close();
clear();
}
catch (Exception e){
}
}
    public void data(){
no=noTiket.getText();
tglmasuk=tftanggal.getText();
plat_no=platNomor.getText();
jns=(String)jenis.getSelectedItem();
jmmasuk=jamMasuk.getText();
}
6. Kembali ke desain form, selanjutnya kita akan membuat fungsi pada button simpan, caranya klik kanan pada button simpan - event - action - actionPerformed lalu ketik script dibawah ini (ketik hanya yang saya block saja)
private void btsimpanActionPerformed(java.awt.event.ActionEvent evt) {                                    

        // TODO add your handling code here:
         konekdatabase();
        data();
        if(no.equals("")||tglmasuk.equals("")||plat_no.equals("")||jns.equals("")||jmmasuk.equals(""))
        {
            JOptionPane.showMessageDialog(null, "HARAP MASUKAN DATA LENGKAP!");
        }
        else{
            simpandata();
            tampildataketabel();
        }

    }

7. jika sudah, selanjutnya kita buat fungsi button cari, caranya sama seperti di atas,. ketik script dibawah
private void btcariActionPerformed(java.awt.event.ActionEvent evt) {                                  
        // TODO add your handling code here:
konekdatabase();
        try
        {
            String cari=noTiket.getText();
            Statement statement=koneksi.createStatement();
            String sql="select * from parkirmasuk where notiket like '"+cari+"'";
            ResultSet rs=statement.executeQuery(sql);
            if(rs.next())
            {
                noTiket.setText(rs.getString(1));
                tftanggal.setText(rs.getString(2));
                platNomor.setText(rs.getString(3));
                jenis.setSelectedItem(rs.getString(4));
                jamMasuk.setText(rs.getString(5));
                }
            else{
                JOptionPane.showMessageDialog(null, "DATA TIDAK ADA DALAM DATABASE");
            }
            statement.close();
            koneksi.close();
        }
        catch (Exception ex)
        {
            System.out.println("Error: "+ex);
        }
    
    }

To be continue . . .



Ok 
Tutorial Lengkap Membuat Aplikasi Parkir Kendaraan Menggunakan Java Netbeans Dan MySQL telah selesai, silahkan kembangkan sesuai kreasi sobat :)


Lab –Configuring Switch Security Features

Lab –Configuring Switch Security Features
Topology
Addressing Table
Device
Interface
IP Address
Subnet Mask
Default Gateway
R1
G0/1
172.16.99.1
255.255.255.0
N/A
S1
VLAN 99
172.16.99.11
255.255.255.0
172.16.99.1
PC-A
NIC
172.16.99.3
255.255.255.0
172.16.99.1
Objectives
Part 1: Set Up the Topology and Initialize Devices
Part 2: Configure Basic Device Settings and Verify Connectivity
Part 3: Configure and Verify SSH Access on S1
·         Configure SSH access.
·         Modify SSH parameters.
·         Verifythe SSH configuration.
Part 4: Configure and VerifySecurity Features on S1
·         Configure and verify general security features.
·         Configure and verify port security.
Background / Scenario
It is quite common to lock down access and install good security featureson PCs and servers. It is important that your network infrastructure devices, such as switches and routers,are also configured with security features.
In this lab, you will follow some best practices for configuring security features on LAN switches. You will only allow SSH and secure HTTPS sessions. You will also configure and verify port security to lock out any device with a MAC address not recognized by the switch.
Note: The router used with CCNA hands-on labsis a Cisco 1941 Integrated Services Router (ISR) with Cisco IOS Release 15.2(4)M3 (universalk9 image). The switch used is a Cisco Catalyst 2960 with Cisco IOS Release 15.0(2) (lanbasek9 image). Other routers, switches, and Cisco IOS versions can be used. Depending on the model and Cisco IOS version, the commands available and output produced might vary from what is shown in the labs.Refer to the Router Interface Summary Table at the end of this lab for the correct interface identifiers.
Note:Make sure that the router and switch have been erased and have no startup configurations. If you are unsure, contact your instructor or refer to the previous lab for the procedures to initialize and reload devices.
Required Resources
·         1 Router (Cisco 1941 with Cisco IOS Release 15.2(4)M3 universal image or comparable)
·         1 Switch (Cisco 2960 with Cisco IOS Release 15.0(2) lanbasek9 image or comparable)
·         1 PC (Windows 7, Vista, or XP with terminal emulation program, such as Tera Term)
·         Console cables to configure the Cisco IOS devices via the console ports
·         Ethernet cables as shown in the topology
Part 1:     Set Up the Topology and Initialize Devices
In Part 1, you will set up the network topology and clear any configurations if necessary.
Step 1:     Cable the network as shown in the topology.
Step 2:     Initialize and reload the router and switch.
If configuration files were previously saved on the router or switch, initialize and reload these devices back to their basic configurations.
Part 2:     Configure Basic Device Settings and Verify Connectivity
In Part 2, you configure basic settings on the router, switch, and PC. Refer to the Topology and Addressing Table at the beginning of this lab for device names and address information.
Step 1:     Configure an IP address on PC-A.
Step 2:     Configure basic settings on R1.
a.     Configure the device name.
b.    Disable DNS lookup.
c.     Configure interface IP address as shown in the Addressing Table.
d.    Assign classas the privileged EXEC mode password.
e.     Assign cisco as the console and vty password and enable login.
f.     Encrypt plain text passwords.
g.    Save the running configuration to startup configuration.
Step 3:     Configure basic settings on S1.
A good security practice is to assign the management IP address of the switch to a VLAN other than VLAN 1 (or any other data VLAN with end users). In this step, you will create VLAN 99 on the switch and assign it an IP address.
a.     Configure the device name.
b.    Disable DNS lookup.
c.     Assign class as the privileged EXEC mode password.
d.    Assign cisco as the console and vty password and then enable login.
e.     Configure a default gateway for S1 using the IP address of R1.
f.     Encrypt plain text passwords.
g.    Save the running configuration to startup configuration.
h.     Create VLAN 99 on the switch and name it Management.
S1(config)# vlan 99
S1(config-vlan)# name Management
S1(config-vlan)# exit
S1(config)#
i.      Configure the VLAN 99 management interface IP address, as shown in the Addressing Table, and enable the interface.
S1(config)# interface vlan 99
S1(config-if)# ip address 172.16.99.11 255.255.255.0
S1(config-if)# no shutdown
S1(config-if)# end
S1#
j.      Issue theshow vlan command on S1. What is the status of VLAN 99? __Active____________________
k.     Issue theshow ip interface brief command on S1. What is the status and protocol for management interface VLAN 99?
________Status “UP” and Protocol “Down”____________________________________________________________________________
Why is the protocol down, even though you issued the no shutdowncommand for interface VLAN 99?
___No Physical ports on the switch have been assigned to vlan 99_________________________________________________________________________________
l.      Assign ports F0/5 and F0/6 to VLAN 99 on the switch.
S1# config t
S1(config)# interface f0/5
S1(config-if)# switchport mode access
S1(config-if)# switchport access vlan 99
S1(config-if)# interface f0/6
S1(config-if)# switchport mode access
S1(config-if)# switchport access vlan 99
S1(config-if)# end
m.   Issue theshow ip interface brief command on S1. What is the status and protocol showing for interface VLAN 99? __Status “UP” and Protocol “UP”_____________________________________________
Note: There may be a delay while the port states converge.
Step 4:     Verify connectivity between devices.
a.     From PC-A, ping the default gateway address on R1. Were your pings successful?_ Success_____________
b.    From PC-A, ping the management address of S1. Were your pings successful? ___ Success ___________
c.     From S1, ping the default gateway address on R1. Were your pings successful? ___ Success ___________
d.    From PC-A, open a web browser and go to http://172.16.99.11. If it prompts you for a username and password, leave the username blank and use classfor the password. If it prompts for secured connection, answer No. Were you able to access the web interface on S1? _ In a real switch the answer is Yes,but in Packet Tracer switch the answer No,Because a Web access or web server can’t be implement on a Packet Tracer switch_____________
e.     Close the browser session on PC-A.
Note: The non-secure web interface (HTTP server) on a Cisco 2960 switch is enabled by default. A common security measure is to disable this service,as described in Part 4.
Part 3:     Configure and Verify SSH Access on S1
Step 1:     Configure SSH access on S1.
a.     Enable SSH on S1.From global configuration mode, create a domain name of CCNA-Lab.com.
S1(config)# ip domain-name CCNA-Lab.com
b.    Create a local user database entry for use when connecting to the switch via SSH. The user should have administrative level access.
Note: The password used here is NOT a strong password. It is merely being used for lab purposes.
S1(config)# username admin privilege 15 secret sshadmin
c.     Configure the transport input for the vty lines to allow SSH connections only, and use the local database for authentication.
S1(config)# line vty 0 15
S1(config-line)# transport input ssh
S1(config-line)# login local
S1(config-line)# exit
d.    Generate an RSA crypto key using a modulus of 1024 bits.
S1(config)# crypto key generate rsa modulus 1024
The name for the keys will be: S1.CCNA-Lab.com

% The key modulus size is 1024 bits
% Generating 1024 bit RSA keys, keys will be non-exportable...
[OK] (elapsed time was 3 seconds)

S1(config)#
S1(config)# end
e.     Verify the SSH configuration and answer the questions below.
S1# show ip ssh
What version of SSH is the switch using?____1.99___________________
How many authentication attempts does SSH allow?_______3________________
What is the default timeout setting for SSH?_____120 Secs__________________
Step 2:     Modify the SSH configuration on S1.
Modify the default SSH configuration.
S1# config t
S1(config)# ip ssh time-out 75
S1(config)# ip ssh authentication-retries 2
How many authentication attempts does SSH allow? ____2___________________
What is the timeout setting for SSH? _______75 Secs________________
Step 3:     Verify the SSH configuration on S1.
a.     Using SSH client software on PC-A (such as Tera Term), open an SSH connection to S1. If you receive a message on your SSH client regarding the host key, accept it. Login with admin for username and sshadmin for the password.
Was the connection successful?____Yes,Success____________________
What prompt was displayed on S1? Why?
S1 is showing the Prompt at privileged EXEC mode because privilege 15 Option was used when configuring unsername and password,that’s why the # Simbol appears on the prompt______________________________________________________________________________
____________________________________________________________________________________
b.    Type exit to end the SSH session on S1.
Part 4:     Configure and Verify Security Features on S1
In Part 4, you will shut down unused ports, turn off certain services running on the switch, and configure port security based on MAC addresses. Switches can be subject to MAC address table overflow attacks, MAC spoofing attacks, and unauthorized connections to switch ports.You will configure port security to limit the number of MAC addresses that can be learned on a switch port and disable the port if that number is exceeded.
Step 1:     Configure general security featureson S1.
a.     Configure a message of the day (MOTD) banner on S1 with an appropriate security warning message.
b.    Issue a show ip interface brief command on S1. What physical ports are up?
_FastEthernet 0/5 and  FastEthernet 0/6 message UP________________________________________________________________________________
c.     Shut down all unused physical ports on the switch. Use the interface range command.
S1(config)# interface range f0/1 – 4
S1(config-if-range)# shutdown
S1(config-if-range)# interface range f0/7 – 24
S1(config-if-range)# shutdown
S1(config-if-range)# interface range g0/1 – 2
S1(config-if-range)# shutdown
S1(config-if-range)# end
S1#
d.    Issue theshow ip interface brief command on S1. What is the status of ports F0/1 to F0/4?
__Administratively Down__________________________________________________________________________________
e.     Issue theshow ip http server status command.
What is the HTTP server status? __In a be by default_________________________
What server port is it using? __ In a be by default _________________________
What is the HTTP secure server status? _____ In a be by default ______________________
What secure server port is it using?____ In a be by default _______________________
f.     HTTP sessions send everything in plain text. You will disable the HTTP service running on S1.
S1(config)# no ip http server
g.    From PC-A, open a web browser session to http://172.16.99.11. What was your result?
_on a real switch if you disable the http service,the web page could not open Http connections will be refused_________________________________________________________________________________
h.     From PC-A, open a secure web browser session athttps://172.16.99.11. Accept the certificate. Login with no username and a password of class. What was your result?
___on a real switch secure web session will be successfull_________________________________________________________________________________
i.      Close the web session on PC-A.
Step 2:     Configure and verify port security on S1.
a.     Record the R1 G0/1 MAC address. From the R1 CLI, use the show interface g0/1 command and record the MAC address of the interface.
R1# show interface g0/1
GigabitEthernet0/1 is up, line protocol is up
  Hardware is CN Gigabit Ethernet, address is 30f7.0da3.1821 (bia 3047.0da3.1821)
What is the MAC address of the R1 G0/1 interface? __0010.fs67.54dr.________________________________________
b.    From the S1 CLI, issue a show mac address-table command from privileged EXEC mode. Find the dynamic entries for ports F0/5 and F0/6. Record them below.
F0/5 MAC address: ____0010.fs67.54dr.__________________________________________________
F0/6 MAC address: ____0020.0a25.5320__________________________________________________
c.     Configure basic port security.
Note: This procedure would normally be performed on all access ports on the switch. F0/5 is shown here as an example.
1)     From the S1 CLI, enter interface configuration mode for the port that connects to R1.
S1(config)#interface f0/5
2)     Shut down the port.
S1(config-if)# shutdown
3)     Enable port security on F0/5.
S1(config-if)# switchport port-security
Note: Entering the switchport port-security command sets the maximum MAC addresses to 1 and the violation action to shutdown. The switchport port-security maximum and switchport port-security violation commands can be used to change the default behavior.
4)     Configure a static entry for the MAC address of R1 G0/1 interface recorded in Step 2a.
S1(config-if)# switchport port-security mac-address xxxx.xxxx.xxxx
(xxxx.xxxx.xxxx is the actual MAC address of the router G0/1 interface)
Note: Optionally, you can use the switchport port-security mac-address stickycommand to add all the secure MAC addresses that are dynamically learned on a port (up to the maximum set) to the switch running configuration.
5)     Enable the switch port.
S1(config-if)# no shutdown
S1(config-if)# end
d.    Verify port security on S1 F0/5 by issuing a show port-security interfacecommand.
S1# show port-security interface f0/5
Port Security              : Enabled
Port Status                : Secure-up
Violation Mode             : Shutdown
Aging Time                 : 0 mins
Aging Type                 : Absolute
SecureStatic Address Aging : Disabled
Maximum MAC Addresses      : 1
Total MAC Addresses        : 1
Configured MAC Addresses   : 1
Sticky MAC Addresses       : 0
Last Source Address:Vlan   : 0000.0000.0000:0
Security Violation Count   : 0
What is the port status of F0/5? ___Secure-Up________________________
e.     From R1 command prompt, ping PC-A to verify connectivity.
R1# ping 172.16.99.3
f.     You will now violate security by changing the MAC address on the router interface. Enter interface configuration mode for G0/1 and shut it down.
R1# config t
R1(config)# interface g0/1
R1(config-if)# shutdown
g.    Configure a new MAC address for the interface, using aaaa.bbbb.cccc as the address.
R1(config-if)# mac-address aaaa.bbbb.cccc
h.     If possible, have a console connection open on S1 at the same time that you do this step. You will see various messages displayed on the console connection to S1 indicating a security violation. Enable the G0/1 interface on R1.
R1(config-if)# no shutdown
i.      From R1 privilegedEXEC mode, ping PC-A. Was the ping successful? Why or why not?
__No,the F0/5 port on S1 is Shutdown because of the security violation__________________________________________________________________________________
j.      On the switch, verify port security with the following commands shown below.
S1#show port-security
Secure Port MaxSecureAddr CurrentAddr SecurityViolation Security Action
               (Count)       (Count)        (Count)
--------------------------------------------------------------------
      Fa0/5            1           1                 1         Shutdown
----------------------------------------------------------------------
Total Addresses in System (excluding one mac per port)     :0
Max Addresses limit in System (excluding one mac per port) :8192

S1# show port-security interface f0/5
Port Security              : Enabled
Port Status                : Secure-shutdown
Violation Mode             : Shutdown
Aging Time                 : 0 mins
Aging Type                 : Absolute
SecureStatic Address Aging : Disabled
Maximum MAC Addresses      : 1
Total MAC Addresses        : 1
Configured MAC Addresses   : 1
Sticky MAC Addresses       : 0
Last Source Address:Vlan   : aaaa.bbbb.cccc:99
Security Violation Count   : 1

S1# show interface f0/5
FastEthernet0/5 is down, line protocol is down (err-disabled)
Hardware is Fast Ethernet, address is 0cd9.96e2.3d05 (bia 0cd9.96e2.3d05)
 MTU 1500 bytes, BW 10000 Kbit/sec, DLY 1000 usec,
reliability 255/255, txload 1/255, rxload 1/255
<output omitted>

S1# show port-security address
                Secure Mac Address Table
------------------------------------------------------------------------
Vlan     Mac Address       Type                 Ports      Remaining Age
                                                           (mins)
----     -----------       ----                 -----   -------------
  99     30f7.0da3.1821    SecureConfigured     Fa0/5        -
-----------------------------------------------------------------------
Total Addresses in System (excluding one mac per port)     :0
Max Addresses limit in System (excluding one mac per port) :8192
k.     On the router, shut down the G0/1 interface, remove the hard-coded MAC address from the router, and re-enable the G0/1 interface.
R1(config-if)# shutdown
R1(config-if)# no mac-address aaaa.bbbb.cccc
R1(config-if)# no shutdown
R1(config-if)# end
l.      From R1, ping PC-A again at 172.16.99.3. Was the ping successful? __Success_______________
m.   On the Switch, issue theshow interface f0/5 command to determine the cause of ping failure. Record your findings.
__FastEthernet 0/5 is down,line protocol is down (err-disabled)__________________________________________________________________________________
n.     Clear the S1 F0/5 error disabled status.
S1# config t
S1(config)# interface f0/5
S1(config-if)# shutdown
S1(config-if)# no shutdown
Note: There may be a delay while the port states converge.
o.    Issue theshow interface f0/5 command on S1 to verify F0/5 is no longer in error disabled mode.
S1# show interface f0/5
FastEthernet0/5 is up, line protocol is up (connected)
  Hardware is Fast Ethernet, address is 0023.5d59.9185 (bia 0023.5d59.9185)
  MTU 1500 bytes, BW 100000 Kbit/sec, DLY 100 usec,
     reliability 255/255, txload 1/255, rxload 1/255
p.    From the R1 command prompt, ping PC-A again. You should be successful.
Reflection
1.     Why would you enable port security on a switch?
__It would help prevent Unauthorized devices from accessing your network,If they plugged into a switch on your network ___________________________________________________________________________________
_______________________________________________________________________________________
2.     Why should unused ports on a switch be disabled?
__a user could not connect a device to the switch on an unused port and access the LAN_____________________________________________________________________________________
_______________________________________________________________________________________
Router Interface Summary Table
Router Interface Summary
Router Model
Ethernet Interface #1
Ethernet Interface #2
Serial Interface #1
Serial Interface #2
1800
Fast Ethernet 0/0 (F0/0)
Fast Ethernet 0/1 (F0/1)
Serial 0/0/0 (S0/0/0)
Serial 0/0/1 (S0/0/1)
1900
Gigabit Ethernet 0/0 (G0/0)
Gigabit Ethernet 0/1 (G0/1)
Serial 0/0/0 (S0/0/0)
Serial 0/0/1 (S0/0/1)
2801
Fast Ethernet 0/0 (F0/0)
Fast Ethernet 0/1 (F0/1)
Serial 0/1/0 (S0/1/0)
Serial 0/1/1 (S0/1/1)
2811
Fast Ethernet 0/0 (F0/0)
Fast Ethernet 0/1 (F0/1)
Serial 0/0/0 (S0/0/0)
Serial 0/0/1 (S0/0/1)
2900
Gigabit Ethernet 0/0 (G0/0)
Gigabit Ethernet 0/1 (G0/1)
Serial 0/0/0 (S0/0/0)
Serial 0/0/1 (S0/0/1)
Note: To find out how the router is configured, look at the interfaces to identify the type of router and how many interfaces the router has. There is no way to effectively list all the combinations of configurations for each router class. This table includes identifiers for the possible combinations of Ethernet and Serial interfaces in the device. The table does not include any other type of interface, even though a specific router may contain one. An example of this might be an ISDN BRI interface. The string in parenthesis is the legal abbreviation that can be used in Cisco IOS commands to represent the interface.


Badii Maulana. Powered by Blogger.

ID Card

klik dibawah ini

QR-CODE InstaForex

Blogroll


Traffic Exchange

Youtube Follow Us :